[Gambas-user] Comments in forms

Dag Jarle Nerland Johansen - Gambas gambas at cd-bahia.com
Wed Feb 24 03:41:14 CET 2021


Hi,
can it happen that comments are automaticity removed from the .form file?
Comments start with #comment, and these lines are removed,

I made program generating form files, but to refresh them without 
destroying changes I made later in the IDE, those parts which must be 
re-generated. For that I wrote 'REF START and 'REF END in the original 
generated form. Funny enough does it work not only one time but 2. The 
third time the comments are gone. I have absolutely no explanation for 
that behaviour. It looks like this:

fsin=originala copy of the form.file renamed previously renamed
fs=the form fie
sc=a tag for different tabs on the form
LB_FLD[i]=List of felds from a MySQL.table
  Do While Not fsin.Eof
     Line Input #fsin, sl
     s = "#REF START " & sc
     If InStr(sl, s) > 0 Then
       Do While s <> "#REF END " & sc ' Overread existing field 
definitions on the data panel
         Line Input #fsin, s
         i = i + 1
       Loop
       Print #fs, "#REF START " & sc
       dy = 3
       For i = 0 To LB_FLD.Count - 1
           MakeField(fs, sc, LB_FLD[i].Text, i)
       Next
       Print #fs, "#REF END " & sc
     Endif
     If Trim(sl) = "#REF START " & sc Then sl = ""
     Print #fs, sl
   Loop
Please no comments on my way to program - I am old fashioned and stay 
so, learned programming in the 80-is, and it worked so...
Thankful for any ideas
Dag


More information about the User mailing list