Page 1 of 1

There is an error in the dialogue

Posted: Thu Jan 02, 2014 3:51 am
by Eugene Lutsenko
There is an error in the dialogue:
to fragment "dialog 13 'everything works fine, but on this fragnmente an error:

Code: Select all

                @ 0,0 DCGROUP oGroup1 CAPTION 'Задайте параметры синтеза модели:' SIZE 88, 22
                
                PUBLIC Arg_MinV := 0, Arg_MaxV := 360, Arg_Delta := 1
                Mess1 = 'Начальное значение аргумента:'
                Mess2 = 'Конечное  значение аргумента:'
                Mess3 = 'Шаг изменения аргумента:'
                @ 1, 1 DCSAY Mess1 PARENT oGroup1
                @ 2, 1 DCSAY Mess2 PARENT oGroup1
                @ 3, 1 DCSAY Mess3 PARENT oGroup1
                @ 1,40 DCSAY "" GET Arg_MinV  PARENT oGroup1 PICTURE "###############"
                @ 2,40 DCSAY "" GET Arg_MaxV  PARENT oGroup1 PICTURE "###############"
                @ 3,40 DCSAY "" GET Arg_Delta PARENT oGroup1 PICTURE "#######.#######"

*********************************
* Diaolog 13

                PUBLIC Ampl := 1
                Mess = 'Начальная амплитуда свип-сигнала:'
                @ 5, 1 DCSAY Mess PARENT oGroup1
                @ 5,40 DCSAY "" GET Ampl PARENT oGroup1 PICTURE "###############"
Image

Than it can be caused and how to fix it?

Line at which this error occurs:
@ 5, 1 DCSAY Mess PARENT oGroup1

Re: There is an error in the dialogue

Posted: Thu Jan 02, 2014 4:08 am
by Wolfgang Ciriack
Try to change the var to Mess1.

Re: There is an error in the dialogue

Posted: Thu Jan 02, 2014 6:32 am
by Eugene Lutsenko
Wolfgang Ciriack wrote:Try to change the var to Mess1.
Thank you!
Cool, but your advice all happened. And what, you can not use a variable Mess?

Re: There is an error in the dialogue

Posted: Thu Jan 02, 2014 7:03 am
by Tom
"MESS(AGE)" is a reserved keyword. The PP tries to interpret this.

Besides, if a DCSAY ... GET doesn't have a SAY portion, you may do this:

Code: Select all

@ 1,1 DCGET nValue PROMPT ... 
All options like SAYSIZE, SAYFONT, GETSIZE a.s.o. work without the prefixes SAY/GET then (@ 1,1 DCGET nValue SIZE 10,1 ...)

Re: There is an error in the dialogue

Posted: Thu Jan 02, 2014 8:54 am
by rdonnay
This is one of the limitations of the pre-processor.

A simple workaround is to place the variable in parenthesis.

Code: Select all

#INCLUDE "dcdialog.ch"

FUNCTION Main()

LOCAL GetList[0], mess := 'Message', oGroup

@ 0,0 DCGROUP oGroup SIZE 10,10

@ 1,1 DCSAY (mess) PARENT oGroup

DCREAD GUI FIT TITLE 'Message test'

RETURN nil

PROC appsys ; return

Re: There is an error in the dialogue

Posted: Thu Jan 02, 2014 9:19 am
by Eugene Lutsenko
Clearly, thanks!

It's funny that there are such moments, and the compiler does not issue in such cases any reasonable comments, which would allow the developer himself to figure out what's wrong and what to do