Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Createobject() and returning a parameter
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00047277
Message ID:
00047908
Vues:
31
>Bela, you've just run into the biggest problem with local variables - just when you want them they've gone out of scope.
>
>1. You can make this variable Public, in which case it will be available in any form.
>
>2. You can store the variable on the calling form, and update it before you close the second form (no need to pass it as a parameter then)
>
>3. You can hide() the second form, pull the information off it from the first form and then programmatically close the second form.
>
>Try these, and see if one will work in your situation.
>
>Barbara
>
>
>>Hi Barbara!
>>
>>My problem was, that if I pass a variable by reference to a form, the Init method is the only place, where I change the parameter, the the calling variable is changing to. But If I store the variable to a property, and later I change this property, the original calling variable wouldnot change.
>>
>>BB
>>
>>>Bela, in the INIT store the variable to a form property which you have designed for this purpose. You can store an array or an object (like a form reference) to a form property exactly as you would store a character or numeric variable. The only thing to remember is for array properties you have to set the property as an array in the first place and then use acopy() to store your variable to the form array property.
>>>
>>>HTH
>>>Barbara


If you use a framework, it could be easy to create a new property to
handle this kind of values.

This property act like a public var. and can be accessible from
anywhere in your application.

Why not use an array to that?

A 2 dimension (2 columns) array can be resized an store
a value in one column and a var name in the other one,
this array can handle more than one value an could be
use for any purpose in an application...

:)
If we exchange an apple, we both get an apple.
But if we exchange an idea, we both get 2 ideas, cool...


Gérald Santerre
Independant programmer - internet or intranet stuff - always looking for contracts big or small :)
http://www.siteintranet.qc.ca
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform