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     [SOLVED] Dialogue Manager problem

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Dialogue Manager problem
 Login/Join
 
Guru
posted
I've got a problem where DM behaves quite strange. What I'm trying to do is to create a generic proc to handle selection values from a HTML page. Single values work fine and multiple (up to 2) work fine but when I get to the 3rd value it populates the string with ********, and when I come to the 4th it gives me arror.

Below is the trace from the loop. Does anone have a clue what's going on?

-REPEAT :inner_loop 4 TIMES
-SET &val4 = '&' || Fixer || 1 ;
-SET &str = '''' | ANDYBIRD | '''';
-SET &sel_string = IF 1 EQ 1 THEN '''' | ANDYBIRD | ''''
- ELSE IF 1 LE 4 THEN '''' | ' ' | '''' |
- ' OR ' | '''' | ANDYBIRD | '''';
-TYPE sel_string 'ANDYBIRD'
sel_string 'ANDYBIRD'
-TYPE sel_string length 10
sel_string length 10
-SET &Fixer_Sel = 'ANDYBIRD';
-SET &y = 1 + 1;
-REPEAT :inner_loop 4 TIMES
-SET &val4 = '&' || Fixer || 2 ;
-SET &str = '''' | CHRISADAMS | '''';
-SET &sel_string = IF 2 EQ 1 THEN '''' | CHRISADAMS | ''''
- ELSE IF 2 LE 4 THEN '''' | 'ANDYBIRD' | '''' |
- ' OR ' | '''' | CHRISADAMS | '''';
-TYPE sel_string 'ANDYBIRD' OR 'CHRISADAMS'
sel_string 'ANDYBIRD' OR 'CHRISADAMS'
-TYPE sel_string length 26
sel_string length 26
-SET &Fixer_Sel = 'ANDYBIRD' OR 'CHRISADAMS';
-SET &y = 2 + 1;
-REPEAT :inner_loop 4 TIMES
-SET &val4 = '&' || Fixer || 3 ;
-SET &str = '''' | CHRISBLEVINS | '''';
-SET &sel_string = IF 3 EQ 1 THEN '''' | CHRISBLEVINS | ''''
- ELSE IF 3 LE 4 THEN '''' | 'ANDYBIRD' OR 'CHRISADAMS' | '''' |
- ' OR ' | '''' | CHRISBLEVINS | '''';
-TYPE sel_string ********
sel_string ********
-TYPE sel_string length 08
sel_string length 08
-SET &sql_string = ********;
-SET &Fixer_Sel = ********;
-SET &y = 3 + 1;
-REPEAT :inner_loop 4 TIMES
-SET &val4 = '&' || Fixer || 4 ;
-SET &str = '''' | CHRISMITCHELL | '''';
-SET &sel_string = IF 4 EQ 1 THEN '''' | CHRISMITCHELL | ''''
- ELSE IF 4 LE 4 THEN '''' | ******** | '''' |
- ' OR ' | '''' | CHRISMITCHELL | '''';
0 ERROR AT OR NEAR LINE 5 IN PROCEDURE mrheaderFOCEXEC *
(FOC260) AN OPERATION IS MISSING AN ARGUMENT

This message has been edited. Last edited by: Håkan,


WebFOCUS DS 8.0.06/08 DS/AS
WebFOCUS RS 8.0.08 (Linux/IBM i)
WebFOCUS Client 8.0.06 (Linux)
 
Posts: 319 | Location: Stockholm, Sweden | Registered: February 04, 2004Report This Post
Expert
posted Hide Post
Hakan, please post the actual DM code as well.

Thanks,


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Virtuoso
posted Hide Post
.. and use the [ code ] [ / code ] tags.

My guess is that you have exraneous .EVAL's in the line that echoed as

-SET &sel_string = IF 3 EQ 1 THEN '''' | CHRISBLEVINS | ''''
- ELSE IF 3 LE 4 THEN '''' | 'ANDYBIRD' OR 'CHRISADAMS' | '''' |
- ' OR ' | '''' | CHRISBLEVINS | '''';
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
Guru
posted Hide Post
Here's the code:

-*
-SET &ECHO = ALL;
-*
-* Test Strings
-DEFAULTS &Depot = 'FOC_NONE', &Depot_Sql = ' '
-DEFAULTS &Opsman = 'FOC_NONE', &Opsman_Sql = ' '
-DEFAULTS &Site = 'FOC_NONE', &Site_Sql = ' '
-DEFAULTS &Fixer = 'FOC_NONE', &Fixer_Sql = ' '
-SET &Depot = 'FOC_NONE';
-SET &Opsman = 'FOC_NONE';
-SET &Fixer0 = 4;
-SET &Fixer1 = 'ANDYBIRD';
-SET &Fixer2 = 'CHRISADAMS';
-SET &Fixer3 = 'CHRISBLEVINS';
-SET &Fixer4 = 'CHRISMITCHELL';
-SET &Parm_Count = 3;
-SET &Parm_String = 'Depot^Opsman^Fixer';
-* End Test Strings
-*
-SET &x1 = 1;
-SET &x2 = &Parm_Count;
-*
-:init
-DEFAULT &sel_string = ' ';
-DEFAULT &sql_string = ' ';
-SET &parm_len = &Parm_String.LENGTH;
-SET &parm_frm = 'A' | &parm_len;
-*
-REPEAT :end_loop FOR &x1 FROM 1 TO &x2
-SET &single_name = ' ';
-SET &val = GETTOK(&Parm_String, &parm_len, &x1, '^', &parm_len, '&parm_frm');
-SET &xtest = '&' | &val || '0.EXIST';
-IF &xtest.EVAL GOTO :multi;
-SET &val2 = '&' | &val;
-SET &len = ARGLEN(&val2.LENGTH, &val2, 'I3') - 1;
-SET &fmt = 'A' | &len;
-SET &val3 = SUBSTR(&len, &val, 1, &len, &len, '&fmt');
-SET &val4 = '&' || &val3 ;
-SET &str = '''' | &val4.EVAL | '''';
-SET &sel_string = IF &val4.EVAL CONTAINS FOC_NONE THEN '''' | ' ' | '''' ELSE '''' | &str.EVAL | '''';
-SET &sql_string = &sel_string;
-SET &selvar = '&' || &val.EVAL || '_Sel' ;
-SET &sqlvar = '&' || &val.EVAL || '_Sql' ;
-SET &selvar.EVAL = IF &sel_string.EVAL EQ ' ' THEN &sel_string.EVAL ELSE &sel_string.QUOTEDSTRING;
-SET &selvar.EVAL = &selvar.EVAL;
-GOTO :end_loop
-*
-:multi
-SET &y = 1;
-SET &str = ' ';
-SET &z = '&' | &val || '0';
-SET &len = ARGLEN(&val.LENGTH, &val, 'I3');
-SET &fmt = 'A' | &len;
-SET &val3 = SUBSTR(&len, &val, 1, &len, &len, '&fmt');
-SET &selvar = '&' || &val.EVAL || '_Sel' ;
-SET &sqlvar = '&' || &val.EVAL || '_Sql' ;
-*
-REPEAT :inner_loop &z.EVAL TIMES
-SET &val4 = '&' || &val3 || &y ;
-SET &str = '''' | &val4.EVAL | '''';
-SET &sel_string = IF &y EQ 1 THEN '''' | &val4.EVAL | '''' 
- ELSE IF &y LE &z.EVAL THEN '''' | &sel_string.EVAL | '''' |
- ' OR ' | '''' | &val4.EVAL | '''';
-TYPE sel_string        &sel_string
-TYPE sel_string length &sel_string.LENGTH
-SET &sql_string = &sel_string;
-SET &selvar.EVAL = &sel_string;
-SET &sqlvar.EVAL = &sql_string;
-SET &y = &y + 1;
-:inner_loop
-*
-:end_loop


WebFOCUS DS 8.0.06/08 DS/AS
WebFOCUS RS 8.0.08 (Linux/IBM i)
WebFOCUS Client 8.0.06 (Linux)
 
Posts: 319 | Location: Stockholm, Sweden | Registered: February 04, 2004Report This Post
Virtuoso
posted Hide Post
Try it with this piece of code:
-SET &sel_string = IF &y EQ 1 THEN '''' | &val4.EVAL | '''' 
- ELSE IF &y LE &z.EVAL THEN &sel_string |
- ' OR ' | '''' | &val4.EVAL | '''';


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
 
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007Report This Post
Guru
posted Hide Post
Gerard

thanks heaps. It's amazing what a couple of qoutes can do. Now it's working exactly as I wanted.

Håkan


WebFOCUS DS 8.0.06/08 DS/AS
WebFOCUS RS 8.0.08 (Linux/IBM i)
WebFOCUS Client 8.0.06 (Linux)
 
Posts: 319 | Location: Stockholm, Sweden | Registered: February 04, 2004Report This Post
Virtuoso
posted Hide Post
My conjecture was well founded.
quote:
-SET &sel_string = IF &y EQ 1 THEN '''' | &val4.EVAL | ''''
- ELSE IF &y LE &z.EVAL THEN '''' | &sel_string.EVAL | '''' | ' OR ' | '''' | &val4.EVAL | '''';


The .EVAL in &sel_string.EVAL is extraneous, and tripped you up.

Without .EVAL, the content of the referenced amper variable is used only after the right-hand-side expression has been parsed; with .EVAL the the contents of the amper var is treated as if it were in the original content of the line of code.

So, with .EVAL, when the value contained in &sel_string included an operator (such as " OR " or "*"), it got treated as such.

In iteration 2 of the loop, " OR " was introduced.
In iteration 3, the presence of OR caused the interpreter to store a numeric result; since the expression was malformed, the result was a number that overflowed (rather than the 0 or 1 that OR should yield), and asterisks were stored.
In iteration 4, .EVAL caused those asterisks to be treated as a numeric operator, and the music stopped with "(FOC260) AN OPERATION IS MISSING AN ARGUMENT"
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report 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     [SOLVED] Dialogue Manager problem

Copyright © 1996-2020 Information Builders