Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Table buffering changes between 3 and 5?
Message
From
02/12/1996 16:14:38
 
 
To
01/12/1996 13:11:55
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00013424
Message ID:
00013973
Views:
30
as I was saying - u may want to add some checks (g)
btw Michel, how about adding this to the VFUG tips (along with a couple of lines explaining why it is needed)
thnx

Arnon

>>well I don't know what's written there but basically something like
>>replace (this.activecontrol.controlsource) with this.activecontol.value
>>should do it
>>naturally you may want to add some checks that the controlsource is defined or if the field is deleted etc.
>
>Ok, once more time, here's the fantastic Buffer() method:
>
>* Save the current buffer
>* Call from Save() and AddNew()
>
>* We need to make sure the hierarchy is not coming from a Valid() event
>* because this will generate an error
>* In Visual FoxPro 5, we are not allowed to call SetFocus() from a Valid() event
>LOCAL lcProgram,lnCompteur
>lcProgram=PROGRAM(1)
>lnCompteur=2
>DO WHILE LEN(lcProgram)>0
> lcProgram=EVALUATE('PROGRAM('+ALLTRIM(STR(lnCompteur))+')')
> lnCompteur=lnCompteur+1
> IF UPPER(RIGHT(lcProgram,6))='.VALID'
> RETURN
> ENDIF
>ENDDO
>
>IF TYPE('_Screen.ActiveForm.ActiveControl')='O'
> IF UPPER(_Screen.ActiveForm.ActiveControl.BaseClass)=='GRID'
> * Test if this is an active grid column
> IF _Screen.ActiveForm.ActiveControl.ActiveColumn0
> IF UPPER(EVAL('_Screen.ActiveForm.ActiveControl.Columns(_Screen.ActiveForm.ActiveControl.ActiveColumn).'+;
> TRIM(_Screen.ActiveForm.ActiveControl.Columns(_Screen.ActiveForm.ActiveControl.ActiveColumn).CurrentControl)+;
> '.BaseClass'))='OPTIONGROUP'
> _Screen.ActiveForm.ActiveControl.SetFocus()
> ELSE
> =EVAL('_Screen.ActiveForm.ActiveControl.Columns(_Screen.ActiveForm.ActiveControl.ActiveColumn).'+;
> TRIM(_Screen.ActiveForm.ActiveControl.Columns(_Screen.ActiveForm.ActiveControl.ActiveColumn).CurrentControl)+;
> '.SetFocus()')
> ENDIF
> ENDIF
> ELSE
> _Screen.ActiveForm.ActiveControl.SetFocus()
> ENDIF
>ENDIF
>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform