Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
lnID = 2 && this is the ID you are looking for
FOR EACH loForm IN _screen.Forms
IF loForm.DataSessionID = lnID
* this is the one you want
ENDIF
ENDFOR
Yepp, this i know.Keep in mind that forms are not the only object that have a DataSessionID
oF1 = CreateObject("myform")
oF2 = CreateObject("myform")
oF1.addchild("child1","Anything")
oF2.addchild("child1","Anything")
oD0 = CreateObject("Anything")
oD1 = oF1.createdetachedobject("Anything")
oD2 = oF2.createdetachedobject("Anything")
* expected output 1,1,2,2,2,3,3,3 (unless you start with multiple datasessions already)
* everything in the default (1) datasession
? Set("Datasession")
? oD0.ShowOwnDatasession()
* oD0, created in the main code, is also part of the default datasession ID 1)
* everything in the same session as form1 (private Datasession ID 2)
? oF1.datasessionid
? oF1.child1.ShowOwnDatasession()
? oD1.ShowOwnDatasession()
* everything in the same session as form2 (private Datasession ID 3)
? oF2.datasessionid
? oF2.child1.ShowOwnDatasession()
? oD2.ShowOwnDatasession()
* oD1 and oD2 are no children objects of form1, still are created in the same data session id
Define Class myform as Form
datasession = 2 &&private
Procedure addchild(name,class)
This.AddObject(name,class)
EndProc
Procedure createdetachedobject(class)
Return CreateObject(class)
EndProc
Enddefine
Define Class Anything as Custom
Procedure ShowOwnDatasession
Return Set("Datasession") && show current (own) datasessionid
Endproc
Enddefine