Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Setting Datasession by Name of Datasession
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00564510
Message ID:
00564913
Vues:
40
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform