Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Button calls a form, form returns values, button code co
Message
From
29/08/2008 16:08:10
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
29/08/2008 10:07:40
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01342942
Message ID:
01343367
Views:
16
>>>>Hi Jay,
>>>>
>>>> How can I keep the other values gathered from Form2 in scope, or return them to Form1?
>>>>
>>>>Store them into properties of the form. Then, in the Unload event create an object based on the EMPTY() class and use ADDPROPERTY() to transfer all values to the object. Return this object or NULL instead of .T. and .F.
>>>
>>>How do I return NULL? Just RETURN NULL?
>>
>>Yes, but not all NULLs have been created equal...
>>
>>If you need your variable to be of a specific type - for example, if a later evaluation might fail if your NULL has the wrong data type - you need to specify a type.
>>
>>For example, if the calling function expects a numeric type, you might do the following:
>>
>>
>>x = 0
>>x = NULL
>>return x
>>
>>
>>Otherwise, the returned value will be of type "L".
>
>So, does this code seem reasonable then?
>
>oDOS = CREATEOBJECT('Empty')
>
>ADDPROPERTY(oDOS, 'DOSBegin', THISFORM.DOSBegin)
>ADDPROPERTY(oDOS, 'DOSEnd', THISFORM.DOSEnd)
>
>IF !THISFORM.Ok
>	oDOS = NULL
>ENDIF
>
>RETURN oDOS
>
Sure, I wanted to add a general comment about NULL values being different types; in this particular case, the CreateObject() should initialize it to type "O". I guess you won't have surprises there.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Reply
Map
View

Click here to load this message in the networking platform