Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Convert DEFINE WINDOW statements to VFP Forms
Message
 
 
À
04/12/2003 12:38:41
Information générale
Forum:
Visual FoxPro
Catégorie:
FoxPro 2.x
Divers
Thread ID:
00855826
Message ID:
00855994
Vues:
12
Tracy,

It shouldn't be too hard to write a parser to read the SAY line and convert it to a label, and a GET to a textbox. Read DEFINE WINDOW title to get your form name:
pseudocode

lcFormName =  ... && ie "lossnotice"
if ( file( lcFormName + ".scx" ) )
   * change name to prevent overwrites...
endif

create form (lcFormName) nowait
aselobj( laForm, 1 )
loForm = laForm[1]
lnLabelCount = 1
for each say
   lcLabelName = "lbl" + transform( lnLabelCount )
   loForm.AddObject( lcLabelName, "yourBaseLabel" )
   loLabel = eval( "loForm." + lcLabelName )
   with loLabel
      .Visible = .t.
      .Top = f( @ coordinate) 
      .Left = f( @ coordinate )
      .Caption = f( the quoted text prompt )
   endwith
   lnLabelCount = lnLabelCount + 1
endfor

for each get
   lcTxtName = "txt" + transform( lnTxtCount )
   loForm.AddObject( lcTxtName, "yourBaseTextbox" )
   ...
endfor
you could be as sophisticated as you want by looking at the type of the field that was equivalent to the old m. binding and use that to determine what control to add to the form.

>
>DEFINE WINDOW editwin FROM 2,6 TO 20+glRow,73 TITLE "LOSS NOTICE" FLOAT SHADOW FONT (glFontName), (glFontSize)
>ACTIVATE WINDOW editwin
>
>@  1, 2 SAY com_name(mpo_insco(pol_number))
>@  7, 2 SAY "Adjuster....:"
>*...
>@  3,51 GET m.lossdate VALID vEpoch(@m.lossdate)
>@  9,16 GET m.pmtfor
>*...
>
>Examples like the above (hundreds of them in our code) must be switched to forms...there are no .scx files for those because they were hand coded...
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform