Text delimiters

This forum is for eXpress++ general support.
Post Reply
Message
Author
User avatar
TWolfe
Posts: 60
Joined: Thu Jan 28, 2010 7:34 am

Text delimiters

#1 Post by TWolfe »

The following line of code has compiled correctly for years. Now a new user is trying to compile my code on a new computer and they are getting compile errors. Any ideas??

@ 5,20 DCSAY IIF(xx='Y',"Yes","No")

The following line (without the single quotes) compiles fine on the new machine????
@ 5,20 DCSAY IIF(xx="Y","Yes","No")

User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Text delimiters

#2 Post by rdonnay »

You have discovered a bug in the Xbase++ pre-processor which shows up in eXpress++ builds 263 and later.

It is because of the following code that was added to DCDIALOG.CH:

Code: Select all

     ;DC_GetListSet(DCGUI_GETLIST,aGETLIST_VARS,                            ;
                     {'DCSAYGET',<(oObject)>,<(oParent)>,<(cText)>,         ;
                       #<nRow>,#<nCol>,#<nWidth>,#<nHeight>} )
I added this as a new feature to support the improvements to the eXpress++ designer.
Unfortunately, the compiler will fail if there is an expression with mixed quotes, because the compiler will wrap everything in brackets if there are mixed quotes (single,double). I don't have a simple solution to this other than to tell you to use all single quotes or all double quotes in any expression used in a DCSAY or DCSAY..GET.
The eXpress train is coming - and it has more cars.

User avatar
TWolfe
Posts: 60
Joined: Thu Jan 28, 2010 7:34 am

Re: Text delimiters

#3 Post by TWolfe »

Thanks Roger,

So:

@ 12,40 DCSAY {||"Current 'Other' Balance"}

Must be changed to:

@ 12,40 DCSAY {||"Current "+chr(39)+"Other"+chr(39)+" Balance"}

A real pain to change in all my code, but as long as I know the rules ....
New users are using later versions of Express, I use 254

SIDE NOTE:

GETTOOLTIP "To use existing list, enter 'Y'"

The above seems to be accepted without error??

User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Text delimiters

#4 Post by rdonnay »

Let me see if I can find a better solution for you by modifying DCDIALOG.CH.
The eXpress train is coming - and it has more cars.

User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Text delimiters

#5 Post by rdonnay »

Your sample does not seem to show a problem with the compiler.
It preprocesses to the following:

Code: Select all

;DC_GetListSet(GetList,70, {'DCSAYGET',,,[{||"Current 'Other' Balance"}], "12","40","50",""} )
So the stringify option <(cText)> works ok in this case, however it does not work in all cases.

If I remove test stringify option and change it to <cText>, then it will preprocess to the following:

Code: Select all

;DC_GetListSet(GetList,70, {'DCSAYGET',,,{||"Current 'Other' Balance"}, "12","40","50",""} )
This still works with the designer, so I am going to suggest that you try the attached DCDIALOG.CH which removes the stringification.
Attachments
dcdialog.zip
(50.43 KiB) Downloaded 684 times
The eXpress train is coming - and it has more cars.

Post Reply