Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Convert DEFINE WINDOW statements to VFP Forms
Message
From
04/12/2003 14:37:55
 
General information
Forum:
Visual FoxPro
Category:
FoxPro 2.x
Miscellaneous
Thread ID:
00855826
Message ID:
00856038
Views:
18
Thanks David, that was sortof what I was thinking of (I hadn't gotten that far yet though!)

I'll give it a try...
Tracy

>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...
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Previous
Reply
Map
View

Click here to load this message in the networking platform