Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Strange Dialog Manager behaviour

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Strange Dialog Manager behaviour
 Login/Join
 
<Pietro De Santis>
posted
This is weird. I have a snippet of DM code:
-SET &ECHO=ALL;

-SET &VAL1 = '';

-SET &TEST1 =
- IF (&VAL1 EQ '.') THEN 'XXX' ELSE 'YYY';

-SET &TEST2 =
- IF ('&VAL1' EQ '.') THEN 'XXX' ELSE 'YYY';

-SET &TEST3 =
- IF ('&VAL1.EVAL' EQ '.') THEN 'XXX' ELSE 'YYY';

-TYPE TEST1: &TEST1
-TYPE TEST2: &TEST2
-TYPE TEST3: &TEST3
that does not work correctly.

When I set the value of &VAL1 to '.', I would expect the result to be XXX, but it is not for TEST2.

When I set the value of &VAL1 to '', I would expect the result to be YYY, but it is not for TEST1 and TEST3.

When I set the value of &VAL1 to 'a', it works correctly - I get YYY for all three TEST values.

I had to do this to make it work.

-SET &ECHO=ALL;

-SET &VAL0 = '.';
-SET &VAL1 = 'X' || &VAL0 || 'X';

-SET &TEST1 =
- IF (&VAL1 EQ 'X.X') THEN 'XXX' ELSE 'YYY';

-TYPE TEST1: &TEST1
What's happening here?

This message has been edited. Last edited by: <Mabel>,
 
Report This Post
Guru
posted Hide Post
Lets see if I can explain this correctly.

To my understanding the reason you are getting incorrect results is because of when the amper variable is being evaluated. By using &VAL1 and '&VAL1.EVAL' they will be replaced with there value before the code runs. '&VAL1' will be replaced with its value after the code runs, this is why it looks right. Since '&VAL1' and '&VAL1.EVAL' are strings not variables by using .EVAL in the string it will cause the variable to replaced with its value before the if statement is processed.

-SET &ECHO=ALL;
-SET &VAL1 = '.';
-SET &TEST1 = IF ('Hi &VAL1' EQ 'Hi .') THEN 'XXX' ELSE 'YYY';
-SET &TEST2 = IF ('Hi &VAL1.EVAL' EQ 'Hi .') THEN 'XXX' ELSE 'YYY';
-TYPE TEST1: &TEST1
-TYPE TEST2: &TEST2

Also if you have a variable that could be '' you may want to use the function ASIS() since '' and 0 will evaluate to the same thing.

-SET &ECHO=ALL;
-SET &VAL1 = '';
-SET &VAL2 = 0;
-SET &TEST1 = IF (ASIS('&VAL1.EVAL') NE 0) THEN 'XXX' ELSE 'YYY';
-SET &TEST2 = IF (ASIS('&VAL2.EVAL') NE 0) THEN 'XXX' ELSE 'YYY';
-SET &TEST3 = IF ('&VAL1.EVAL' NE 0) THEN 'XXX' ELSE 'YYY';
-SET &TEST4 = IF ('&VAL2.EVAL' NE 0) THEN 'XXX' ELSE 'YYY';
-TYPE TEST1: &TEST1
-TYPE TEST2: &TEST2
-TYPE TEST3: &TEST3
-TYPE TEST4: &TEST4
 
Posts: 406 | Location: Canada | Registered: May 31, 2004Report This Post
<Pietro De Santis>
posted
Curtis, thanks for your explanation. I was aware of the difference between '&AVR.EVAL, '&VAR' and '&VAR', but this does not explain why, when the amper value being tested is a . (dot), the DM code does not work.

Thanks,

Pietro.
 
Report This Post
Expert
posted Hide Post
hmmm what an intersting prob.
The dot operator is a comment signal to scripting languages, so i'm guessing that DM somehow is tripping over that.
The empty is more puzzling:
given &VAL1='';
then &VAL1.EXIST equals 1
and &VAL1.LENGTH also equals 1
both of which are counter-intuitive results ,to me. I'm expecting 0 at least for the second test. Meaning &VAL1=''; is the same as &VAL1=' ';, hmmm.
How about seeing if the hex translation is a hex40, a real blank.
Your work around certainly seems totally reasonable.
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Platinum Member
posted Hide Post
What is your NODATA setting? I seem to remember that we had some problems with a DM situation with NODATA = . (dot, that is).
 
Posts: 124 | Location: Lebanon, New Hampshire | Registered: April 24, 2003Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Strange Dialog Manager behaviour

Copyright © 1996-2020 Information Builders