Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Variables passed by reference
Message
 
To
15/04/2000 21:22:59
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00360010
Message ID:
00360068
Views:
9
That won't work for me. I can get the form to work using a private variable in the calling procedure. I'd just like to be able to use a local variable. It might not be possible.

>What the others have been trying to get you to use is an object instead of a character memvar. The following code does what I *think* you are trying for.
>
>LOCAL loName, loForm
>
>loName = CREATEOBJECT( 'Variable', "John Q. Public" )
>loForm = CREATEOBJECT("TestForm",loName)
>loForm.SHOW(1)
>
>ACTIVATE SCREEN
>
>?loName.value  && This has to be the value typed into the form
>
>DEFINE CLASS Variable AS CUSTOM
>	value = ''
>	
>	PROCEDURE Init
>	LPARAMETER tcValue
>	this.value = tcValue
>	ENDPROC
>	
>ENDDEFINE
>
>DEFINE CLASS TestForm AS Form
>  AUTOCENTER = .T.
>  WIDTH = 150
>  HEIGHT = 74
>  Test = ""
>
>  ADD OBJECT txt1 AS TEXTBOX WITH ;
>    HEIGHT = 22, ;
>    LEFT = 10, ;
>    TOP = 10, ;
>    WIDTH = 130
>
>  ADD OBJECT cmd1 AS COMMANDBUTTON WITH ;
>    CAPTION = "Exit", ;
>    HEIGHT = 22, ;
>    LEFT = 45, ;
>    TOP = 40, ;
>    TERMINATEREAD = .T., ;
>    WIDTH = 60
>
>  PROCEDURE INIT
>  LPARAMETER p1
>
>  this.test = p1
>  THIS.txt1.CONTROLSOURCE = "THISFORM.Test.value"
>
>  ENDPROC
>
>ENDDEFINE
>
>
Brien R. Givens

Brampwood Systems
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform