Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
BindControls & Grids bug
Message
De
11/01/2006 10:31:05
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
BindControls & Grids bug
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01085639
Message ID:
01085639
Vues:
64
I think I have found a VFP9 bug, can anyone confirm, recreate?

I have a subform with a data displayed on it, it is called from a master form which controls all the data and has a private datasession.

The subform has no data of it's own and therefore I have set .BindControls=.F. and in the init event I set the datasessionID to the master forms ID and .BindControls=.T.

This worked fine untill I decided to display a grid on my subform, now the .BindControls=.T. produces an "syntax error" message. after much searching trough my code looking for something strange in my code I foung that .BindControls does not seem to like grids!

If you copy & run my sample below, form2 will run ok and will display the data in the textbox. form3 will error on the .BindControls=.T. line.

Can anyone confirm I am not going mad and any work around?


Gary Williams



Code Sample:
PUBLIC oform1,oform2,oform3

oform1=CREATEOBJECT("frmTest1")
oform1.Show
RETURN


DEFINE CLASS frmTest1 AS FORM
  DataSession=2  && Private

  FUNCTION init
    CREATE CURSOR myTest (Fld1 C(10), fld2 N(8) )
    INSERT INTO MyTest (fld1,fld2) VALUES ("Test123",9999)
    
  
  ENDFUNC

  ADD OBJECT cmdForm2 AS CommandButton WITH ;
    Top=50, ;
    Left=10, ;
    Height=25, ;
    Caption="Form2"  

  FUNCTION cmdForm2.Click
    oform2=CREATEOBJECT("frmTest2",THISFORM)
    oform2.Show()   
  ENDFUNC

  ADD OBJECT cmdForm3 AS CommandButton WITH ;
    Top=150, ;
    Left=10, ;
    Height=25, ;
    Caption="Form3"  

  FUNCTION cmdForm3.Click
    oform3=CREATEOBJECT("frmTest3",THISFORM)
    oform3.Show()   
  ENDFUNC
  
ENDDEFINE


DEFINE CLASS frmTest2 AS FORM
  DataSession=2  && Private
  BindControls=.F.
  top=100
  Left=100
  
  FUNCTION init
    LPARAMETERS toForm1    
    SET DATASESSION TO toForm1.DataSessionID
    THIS.BindControls=.T.   
  ENDFUNC
  
  ADD OBJECT txtDisplay AS Textbox WITH ;
    Left=50, ;
    Top=50, ;
    ControlSource="MyTest.fld1"
 
ENDDEFINE


DEFINE CLASS frmTest3 AS FORM
  DataSession=2  && Private
  BindControls=.F.   &&  <--- Will error here!
  top=200
  Left=200
  
  FUNCTION init
    LPARAMETERS toForm1    
    SET DATASESSION TO toForm1.DataSessionID
    THIS.BindControls=.T.   
  ENDFUNC
  
  ADD OBJECT tstGrid AS grid WITH ;
    Top=50, ;
    RecordSource="MyTest"
 
ENDDEFINE
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform