Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Bug? in grid control & multiple data sessions: data vani
Message
From
14/01/2003 18:01:41
Paul Dorrington
Dorrodata Computing Pty Ltd
Carlton, Australia
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00741303
Message ID:
00741673
Views:
20
>What do you mean by "makes a call to another object
>to change the datasession"? Can you provide code
>that shows what you mean here?

Certainly. Assume I have a form (form1) with a grid on it and button. The form is called from the code snippet below

DO FORM form1
READ EVENTS

DEFINE CLASS custtest AS custom

FUNCTION DOSTUFF
SET DATASESSION TO 1

WAIT WINDOW "Custom object: Data session: " + ;
LTRIM(STR(SET('DATASESSION'))) TIMEOUT 1

SET DATASESSION TO 2
ENDFUNC

ENDDEFINE

The button click event has the following code in it.

LOCAL lnDataSession

WAIT WINDOW "FORM Data session: " + ;
LTRIM(STR(SET('DATASESSION'))) TIMEOUT 1

lnDataSession = SET('DATASESSION')

ocusttest = CREATEOBJECT("custtest")
ocusttest.dostuff()

SET DATASESSION TO lnDataSession

WAIT WINDOW "FORM Data session: " + ;
LTRIM(STR(SET('DATASESSION'))) TIMEOUT 1


If the code in the dostuff() method of the custom object is placed unchanged into the click event of the button the grid loses its data but because the code is contained within the custom object the grid works perfectly.
Previous
Reply
Map
View

Click here to load this message in the networking platform