Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Convert DEFINE WINDOW statements to VFP Forms
Message
 
 
To
04/12/2003 12:38:41
General information
Forum:
Visual FoxPro
Category:
FoxPro 2.x
Miscellaneous
Thread ID:
00855826
Message ID:
00855994
Views:
14
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform