Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Holding the name of a control as a string?
Message
From
04/03/2002 15:32:32
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00628023
Message ID:
00628025
Views:
17
Use this:

strCommand = "thisform." + alltrim(strControl) + ".setfocus()"
&strCommand

Hope it helps.



>Hi another simple one but I am useless at this!!!
>
>I am storeing the name of the last control a user was in on a form in a form property and I have this in the lostfocus of the form...
>
>
>local lnAnswer, strControl
>
>if thisform.mDataChanged()
>
>lnAnswer = messagebox('     Please Save or Undo changes before launching another screen...          ', ;
>0 + 64 + 0, 'System Message')
>strControl = thisform.pLastControl
>if !strControl = ""
>if pemstatus(thisform, (strControl), 5)
>thisform.(&strControl).setfocus()
>endif
>endif
>thisform.(strControl).setfocus()
>thisform.mGetStatus()
>return .f.
>endif
>
>BUT I cannot get the thisform.thisbloomingcontrol.setfocus() right - I have tried &strControl [strControl] and everything in between... please put me out of my mysery!!!
Brian McCord
President
Sagacity Systems
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform