Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Returning an array from a form
Message
De
15/04/2005 20:00:00
 
 
À
15/04/2005 06:38:26
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 7
Database:
Visual FoxPro
Divers
Thread ID:
01004788
Message ID:
01005391
Vues:
30
Oh, but you can return an array, starting with VFP7:
ox = CREATEOBJECT("retarray")
z = ox.ra()
?z[3], ALEN(z,1)   && Three, 5

DEFINE CLASS retarray as Session
DIMENSION arret[5]
FUNCTION ra
  this.arret[1]="One"
  this.arret[2]="Two"
  this.arret[3]="Three"
  this.arret[4]="Four"
  this.arret[5]="Five"
  RETURN @this.arret
ENDFUNC
ENDDEFINE
>I'm new to VFP7 and am trying to return an array from a form and have not been able to do so. Can anyone help -- THANKS
>
>That's because you can't return an array < s >. But you can pass back an object that has an array property. My class libraries have a class called xParameters that I use for just this purpose:
>
>
>DEFINE CLASS xparameters AS custom
>Name = "xparameters"
>DIMENSION aparameters[1]
>
>PROCEDURE Init
>LPARAMETERS taParameters
>
>*** Copy array passed by reference, before it goes out of scope
>ACOPY( taParameters, THIS.aParameters )
>ENDPROC
>ENDDEFINE
>
>
>To use it, you just use code like this:
>
>
>RETURN CREATEOBJECT( 'xParameters', @laMyArray )
>
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform