Subject Re: if-endif statement disappear when running the from
From Akshat Kapoor <akshat.kapoor@kapoorsons.in>
Date Sun, 21 May 2017 12:11:06 +0530
Newsgroups dbase.getting-started

On 21/05/2017 08:28, AGOSTINHO wrote:
> Dear Group,
> When running(DO) this form the if-endiif statement will disappear  from the source code, only the endif will remain on the source file.
> how to prevent this to happen?
>
> parameter bModal
> local f
> f = new pagoForm()
> if (bModal)
>    f.mdi = false // ensure not MDI
>    f.readModal()
> else
>    f.open()
> endif
>
> class pagoForm of FORM
>    with (this)
>       height = 16.0
>       left = 28.2222
>       top = 7.92
>       width = 40.0
>       text = ""
>    endwith
>
>    this.PRIJSORA = new ENTRYFIELD(this)
>    with (this.PRIJSORA)
>       height = 2.16
>       left = 20.0
>       top = 1.44
>       width = 18.0
>       picture = "99999.99"
>       value = "     .  "
>       validRequired = true
>    endwith
>
>    this.PRIJSDIA = new ENTRYFIELD(this)
>    with (this.PRIJSDIA)
>       height = 2.16
>       left = 20.0
>       top = 4.32
>       width = 18.0
>       picture = "99999.99"
>       value = "     .  "
>    endwith
>
>    this.TOTALORA = new ENTRYFIELD(this)
>    with (this.TOTALORA)
>       height = 2.16
>       left = 20.0
>       top = 7.92
>       width = 18.0
>       picture = "99999.99"
>       value = "     .  "
>    endwith
>
>    this.PAGOTOTAL = new ENTRYFIELD(this)
>    with (this.PAGOTOTAL)
>       height = 2.16
>       left = 18.6667
>       top = 12.96
>       width = 18.0
>       picture = "99999.99"
>       value = 25.0
>    endwith
>
>    this.TEXT1 = new TEXT(this)
>    with (this.TEXT1)
>       height = 2.16
>       left = 1.3333
>       top = 1.44
>       width = 14.0
>       text = "prijs pa ora"
>    endwith
>
>    this.TEXT2 = new TEXT(this)
>    with (this.TEXT2)
>       height = 2.16
>       left = 1.3333
>       top = 4.32
>       width = 14.0
>       text = "Prijs Pa dia"
>    endwith
>
>    this.TEXT3 = new TEXT(this)
>    with (this.TEXT3)
>       height = 2.88
>       left = 1.3333
>       top = 7.92
>       width = 14.0
>       text = "Total Horas"
>    endwith
>
>    this.TEXT4 = new TEXT(this)
>    with (this.TEXT4)
>       height = 1.6
>       left = 2.0
>       top = 13.68
>       width = 16.0
>       text = "Total Pago na Naf"
>    endwith
>
>    if this.prijsora.value<>0
>           this.pagototal.value=25
>    endif

I will explain a little further Ken's statment.
This if endif will not be executed in any case even if it remains in the
.wfm file.

using the do ????.wfm will not remove it but opening it in the form
designer will as it does not recognise the code.

When do you want this if / endif to be executed.
In the current position it will never be executed.

You must make it a part of a function to retain it in the wfm file.
You must call it using a event to execute it.

I had also faced this problem when designing my first form.
Regards
Akshat