Results 1 to 2 of 2

Thread: vn

  1. #1
    Join Date
    Dec 1969

    Default vn

    How do you create and class array....<BR><BR>eg... <BR><BR>class user_name<BR> public lname<BR> public fname<BR>end class<BR><BR>i would like to create an array of user_name objects??<BR><BR>thoughts? suggestions? can&#039;t be done?<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default Array of user-defined objects...

    If you understand user-defined classes, then this is a really easy question.<BR><BR>Have you not yet even *tried* to make it work???<BR><BR>Several ways. Two of them, just to get started:<BR><BR>&#060;%<BR>myArray = Array( NEW user_name, NEW user_name, NEW user_name )<BR>%&#062;<BR><BR>That&#039;s not real useful, as all the elements are initialized to "blank" objects.<BR><BR>&#060;%<BR>Dim myArray( 4 )<BR>For i = 0 TO 4<BR>&nbsp; &nbsp; temp = NEW user_name<BR>&nbsp; &nbsp; temp.Setup( someLastName, someFirstName ) &#039; assumes Setup method exists<BR>&nbsp; &nbsp; Set myArray( i ) = temp<BR>Next<BR>%&#062;<BR><BR>There is nothing special about putting user-defined objects into an array. No different than assigning to a non-array variable.<BR><BR>Were you, by chance, forgetting the SET keyword?<BR><BR><BR>&nbsp; &nbsp;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts