Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Setting Datasession by Name of Datasession
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00564510
Message ID:
00564913
Views:
39
This message has been marked as the solution to the initial question of the thread.
How does it not worK?
lparameter tcFormName
if vartype(tcFormName) <> "C"
   return .null.
endif
tcFormName = alltrim(upper(tcFormName))
if empty(tcFormName)
   return .null.
endif
local lnI, loForm
loForm = .null.
for lnI = 1 to _screen.formcount
    if upper(_screen.forms[lnI].name) == tcFormName
       loForm = _screen.forms[lnI]
       exit
    endif
endfor
return loForm
Returning loForm returns an object reference to the form you are looking for. Now you can get any any information about that form, its DE, etc., you want.

>The _screen.* option did not work. I did notice that each session is named and it would be ideal to select datasessions by name instead of numbered ID. Since I am working with a multi-window environment there is no set numbered order assigned to each session, the numbering order is set in the order that each form is open.
>
>The only other option I see is to step through each session to check for the needed table that I am looking for, and then handle any errors due to an invalid datasession number.
>
>Is there any other way of setting a datasession based on the datasession name?
>
>Thank you in advance.
>
>Alex Rodriguez
Mark McCasland
Midlothian, TX USA
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform