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] Manipulating values passed from multiselect control to fex

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Manipulating values passed from multiselect control to fex
 Login/Join
 
Silver Member
posted
Hi all, I am just having way more problems with this than I should.

I have a multiselect capable list box that will pass in a list of numbers. This works wonderfully for use in the report however I also need to manipulate these values to a different format.

The values passed look like:
'1' OR '3' OR '12' OR '640'

I need to convert these numbers into a string where each number is padded with leading zeros up to three digits long and concatonated together.
001003012640

Every character function I throw at my parameters only returns the first value of 1.

How can I get around this?

Thanks.

This message has been edited. Last edited by: lenny,


WebFOCUS 8202M
Client: Windows Server 2012R2/Tomcat 8.0/IIS
Server: IBM i v7r2m0
MS-SQL
 
Posts: 28 | Location: Saskatchewan, Canada | Registered: March 03, 2011Report This Post
Guru
posted Hide Post
Here is what I came up with using Dialog Manager. Maybe someone can come up with a more elegant solution.
  
-SET &ECHO = 'OFF';

-* Initialize variables
-SET &VAR_CNT = 0;
-SET &VAR_LST = '''1'' OR ''3'' OR ''12'' OR ''640''';
-SET &VAR_STR = '';

-* Get rid of the Single Quotes
-SET &VAR_TMP1 = STRREP(&VAR_LST.LENGTH, &VAR_LST.QUOTEDSTRING, 1, '''', 0,  'X', &VAR_LST.LENGTH, 'A&VAR_LST.LENGTH');
-TYPE &VAR_TMP1

-* Change OR to a delimiter. So we can use GETTOK in the padding loop. 
-* Also handle case where user makes only one selection.
-SET &VAR_TMP2 = IF (&VAR_TMP1 CONTAINS 'OR') THEN STRREP(&VAR_TMP1.LENGTH, &VAR_TMP1 || '', 4, ' OR ', 1,  '~', &VAR_TMP1.LENGTH, 'A&VAR_TMP1.LENGTH') 
-                ELSE &VAR_TMP1;
-TYPE &VAR_TMP2

-* Detemine how many items the user selected
-SET &POS_DELIM = 1;
-SET &INPUT_STR = TRUNCATE(&VAR_TMP2);

-REPEAT LOOP_CNT WHILE &POS_DELIM NE 0;
-SET &POS_DELIM = POSIT(&INPUT_STR, &INPUT_STR.LENGTH, '~', '1', 'I8');
-SET &INPUT_STR = SUBSTR(&INPUT_STR.LENGTH, &INPUT_STR, &POS_DELIM + 1, &INPUT_STR.LENGTH, &INPUT_STR.LENGTH, 'A&INPUT_STR.LENGTH');  
-SET &VAR_CNT = &VAR_CNT + 1;
-LOOP_CNT
-TYPE &VAR_CNT

-* Add padding and build string
-STRT_PAD
-REPEAT LOOP_VAR FOR &N FROM 1 TO &VAR_CNT STEP 1
-SET &VAR_TMP3 = GETTOK(&VAR_TMP2, &VAR_TMP2.LENGTH, &N, '~', &VAR_TMP2.LENGTH, 'A&VAR_TMP2.LENGTH');
-SET &VAR_ITM = TRUNCATE(&VAR_TMP3);
-SET &VAR_STR = IF &VAR_ITM.LENGTH EQ 1 THEN TRUNCATE(&VAR_STR) || '00' || &VAR_ITM ELSE
-               IF &VAR_ITM.LENGTH EQ 2 THEN TRUNCATE(&VAR_STR) || '0'  || &VAR_ITM ELSE
-               IF &VAR_ITM.LENGTH EQ 3 THEN TRUNCATE(&VAR_STR) || &VAR_ITM;
-LOOP_VAR

-* Final string
-TYPE &VAR_STR


WebFOCUS 8.1.05M Unix Self-Service/MRE/Report Caster - Outputs Excel, PDF, HTML, Flat Files
 
Posts: 320 | Location: Memphis, TN | Registered: February 12, 2008Report This Post
Expert
posted Hide Post
No more elegant!

-SET &ECHO=ALL;

-SET &VAR1 = '''1'' OR ''3'' OR ''12'' OR ''640''';
-TYPE VAR1 &VAR1

-* Replace OR by blank
-SET &VAR1A = STRREP(&VAR1.LENGTH, &VAR1, 4, ' OR ', 1, ' ', &VAR1.LENGTH, 'A&VAR1.LENGTH');
-TYPE VAR1A &VAR1A

-* Strip single-quotes
-SET &VAR1A_LENGTH = ARGLEN(&VAR1A.LENGTH, &VAR1A, 'I4');
-SET &VAR1B = STRIP(&VAR1A_LENGTH, &VAR1A, '''', 'A&VAR1A_LENGTH.EVAL');
-TYPE VAR1B &VAR1B

-* Determine string pattern
-SET &VAR1B_LENGTH = ARGLEN(&VAR1B.LENGTH, &VAR1B, 'I4');
-SET &VAR1C = PATTERN(&VAR1B_LENGTH, &VAR1B,  'A&VAR1B_LENGTH.EVAL');
-TYPE &VAR1C

-* Replace blanks in string pattern by $
-SET &VAR1C_LENGTH = ARGLEN(&VAR1C.LENGTH, &VAR1C, 'I4');
-SET &VAR1D = STRREP(&VAR1C_LENGTH, &VAR1C, 1, ' ', 1, '$', &VAR1C_LENGTH, 'A&VAR1C_LENGTH.EVAL');
-TYPE &VAR1D

-* Temporarily add $ at beginning and end of pattern
-SET &VAR1D = '$' || &VAR1D || '$';
-TYPE &VAR1D

-* Temporarily double the $
-SET &VAR1D = STRREP(&VAR1D.LENGTH, &VAR1D, 1, '$', 2, '$$', 500, 'A500');
-TYPE &VAR1D

-* Add correct amount of zeros to pattern
-SET &VAR1D_LENGTH = ARGLEN(&VAR1D.LENGTH, &VAR1D, 'I4');
-SET &VAR1E = STRREP(&VAR1D_LENGTH, &VAR1D, 3, '$9$' , 5, '$009$', 500, 'A500');
-SET &VAR1F = STRREP(500          , &VAR1E, 4, '$99$', 5, '$099$', 500, 'A500');
-TYPE &VAR1F

-* Replace the double $ by single $
-SET &VAR1G = STRREP(&VAR1F.LENGTH, &VAR1F, 2, '$$', 1, '$', 500, 'A&VAR1F.LENGTH');
-TYPE &VAR1G

-* Remove temporarily added $ at beginning and end of pattern
-SET &VAR1G_LENGTH = ARGLEN(&VAR1G.LENGTH, &VAR1G, 'I4');
-SET &VAR1G_LENGTHM = &VAR1G_LENGTH - 2;
-SET &VAR1H = SUBSTR(&VAR1G_LENGTH, &VAR1G, 2, &VAR1G_LENGTH - 1, &VAR1G_LENGTHM, 'A&VAR1G_LENGTHM.EVAL');
-TYPE &VAR1H

-* Use the modified pattern to set up the value with the correct number of zeros
-SET &VAR1I = EDIT(&VAR1B,'&VAR1H.EVAL');

-TYPE &VAR1I


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
Silver Member
posted Hide Post
This looks promising however &VAR_LST comes in as
&VAR_LST='1' OR '3' OR '12' OR '640'

and I cannot strip out those single quotes any way I've tried.

I have no control over the quotes around these values as this is how it's passed from the HTML page.


WebFOCUS 8202M
Client: Windows Server 2012R2/Tomcat 8.0/IIS
Server: IBM i v7r2m0
MS-SQL
 
Posts: 28 | Location: Saskatchewan, Canada | Registered: March 03, 2011Report This Post
Expert
posted Hide Post
-* Strip single-quotes 
-SET &VAR_LST_LENGTH = ARGLEN(&VAR_LST.LENGTH, &VAR_LST, 'I4'); 
-SET &VAR1B = STRIP(&VAR_LST_LENGTH, &VAR_LST, '''', 'A&VAR_LST_LENGTH.EVAL');


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
Expert
posted Hide Post
Here is another way using TABLE FILE AND HOLD FORMAT BINARY OR SAVB.

-SET &VAR1 = '''1'' OR ''3'' OR ''12'' OR ''640''';

-SET &STRIP1 = STRREP(&VAR1.LENGTH, &VAR1, 1, '''', 0, 'X', &VAR1.LENGTH, 'A&VAR1.LENGTH');
-SET &STRIP2 = STRREP(&STRIP1.LENGTH, &STRIP1 , 4, ' OR ', 2, HEXBYT(13,'A1') | HEXBYT(10,'A1') | 'X', &STRIP1.LENGTH, 'A&STRIP1.LENGTH');

FILEDEF PARMS DISK parms.ftm

-RUN

-WRITE PARMS &STRIP2

EX -LINES 4 EDAPUT MASTER,PARMS,CV,FILE
FILENAME=PARMS, SUFFIX=FIX,$
SEGNAME=PARMS, $
  FIELD=NUM,ALIAS=  ,I3 ,A3,$

DEFINE FILE PARMS
 ANUM/A3 = FTOA(NUM,'(F3L)','A3') ;
END
TABLE FILE PARMS
PRINT ANUM
ON TABLE HOLD AS NUM_PARM FORMAT BINARY
END

-RUN
-SET &CHARS1 = &LINES * 4 ;
-SET &CHARS2 = &LINES * 3 ;

-READ NUM_PARM &VAR1L.A&CHARS1.EVAL.
-SET &VAR1L = STRREP(&CHARS1,&VAR1L,1,' X',0,'X',&CHARS2,'A&CHARS2.EVAL') ;

-TYPE &VAR1L


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Member
posted Hide Post
You should try to use the same table where is your data with an EDIT, ACROSS and a -READ

example using the CAR FILE

-SET &VAR1 = '''1'' OR ''3'' OR ''12'' OR ''640''';
DEFINE FILE CAR
MYSORT/I3=DECODE SEATS ('5' 1 '2' 3 '4' 12 ELSE 640);
MYDATA/A3=EDIT(MYSORT);
END
TABLE FILE CAR
WHERE MYSORT EQ &VAR1
SUM MYDATA
ACROSS MYDATA
ON TABLE SAVE FORMAT ALPHA
END
-RUN
-READ SAVE, &MYDATA
-RUN
-TYPE &MYDATA

Herve
 
Posts: 4 | Registered: March 28, 2012Report This Post
Expert
posted Hide Post
Great idea, depending on the cost.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Virtuoso
posted Hide Post
Here's another all Dialogue Manager solution:

-SET &VAR_LIST = '''1'' OR ''3'' OR ''12'' OR ''640''';
-TYPE &VAR_LIST
-*
-SET &STRREP_LIST = STRREP(&VAR_LIST.LENGTH,&VAR_LIST,1,'''',0,'x',&VAR_LIST.LENGTH,'A&VAR_LIST.LENGTH');
-SET &TRUNC_LIST = TRUNCATE(&STRREP_LIST);
-SET &VAR_COUNT = (&VAR_LIST.LENGTH - &TRUNC_LIST.LENGTH) / 2 ;
-SET &DELIM_LIST = STRREP(&TRUNC_LIST.LENGTH,&TRUNC_LIST,4,' OR ',1,';',&TRUNC_LIST.LENGTH,'A&TRUNC_LIST.LENGTH');
-*
-SET &VAR = '';
-*
-REPEAT :ENDREPEAT1 FOR &I FROM 1 TO &VAR_COUNT
-SET &VAR_TOKEN = GETTOK(&DELIM_LIST,&DELIM_LIST.LENGTH,&I,';',3,'A3');
-SET &TRUNC_TOKEN = TRUNCATE(&VAR_TOKEN);
-SET &VAR = IF (&TRUNC_TOKEN.LENGTH EQ 3) THEN (&VAR || &TRUNC_TOKEN)         ELSE
-           IF (&TRUNC_TOKEN.LENGTH EQ 2) THEN (&VAR || '0' || &TRUNC_TOKEN)  ELSE
-           IF (&TRUNC_TOKEN.LENGTH EQ 1) THEN (&VAR || '00' || &TRUNC_TOKEN) ELSE '???';
-TYPE &VAR
-:ENDREPEAT1


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Report This Post
Expert
posted Hide Post
As we're all having a go, here's my thoughts Wink

Replace each ' OR ' with two spaces plus a carriage return and line feed before placing into a temporary file. Now read that file line by line, adding a little FPRINT magic along the way ....

By pushing the crlf in front of each number it effectively left justifys each one on a new line with at least two trailing spaces, giving a minimum of 3 chars per line. Tell FPRINT that these are formatted as integers with leading zeroes and voila ....

-DEFAULT &VAR4 = '';
FILEDEF VARLIST DISK VARLIST.FTM
-RUN
-SET &VAR1 = '''1'' OR ''3'' OR ''12'' OR ''640''';
-SET &VAR2 = STRREP(&VAR1.LENGTH,STRREP(&VAR1.LENGTH,&VAR1,1,'''',0,'x',&VAR1.LENGTH,'A&VAR1.LENGTH'),4,' OR ',4,'  '|HEXBYT(13,'A1')||HEXBYT(10,'A1'),&VAR1.LENGTH,'A&VAR1.LENGTH');
-WRITE VARLIST &VAR2
-READ VARLIST NOCLOSE &VAR3.3
-REPEAT :Loop WHILE &IORETURN EQ 0;
-SET &VAR4 = &VAR4||FPRINT(&VAR3,'I3L','A3');
-READ VARLIST NOCLOSE &VAR3.3
-:Loop
-TYPE &VAR4


Editted to add -

Hmmm, just spotted that Waz had used FTOA in the same way, ah well great minds thnk alike ..... etc. Wink

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Expert
posted Hide Post
To cater for a single digit last character, just concatenate two spaces onto the -WRITE VARLIST &VAR2 to become -WRITE VARLIST &VAR2||' '.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Virtuoso
posted Hide Post
A bit of a mix:
  
-DEFAULT &VAR4 = ''
FILEDEF VARLIST DISK VARLIST.FTM
-RUN
-SET &VAR1 = '''1'' OR ''3'' OR ''12'' OR ''640''';
-SET &VAR1L = &VAR1.LENGTH;
-SET &VAR2 = STRIP(&VAR1L, CTRAN(&VAR1L, CTRAN(&VAR1L, &VAR1, BYTVAL('O', 'I3'), 13, 'A&VAR1L.EVAL'), BYTVAL('R', 'I3'), 10, 'A&VAR1L.EVAL'), '''', 'A&VAR1L.EVAL');
-WRITE VARLIST &VAR2
-RUN
EX -LINES 4 EDAPUT MASTER,VARLIST,CV,FILE
FILENAME=PARMS, SUFFIX=FIX,$
SEGNAME=PARMS, $
  FIELD=NUM,ALIAS=  ,I3L ,A4,$
-RUN
TABLE FILE VARLIST
SUM NUM ACROSS NUM
ON TABLE SAVE
END
-RUN
-READ SAVE,&VAR4
-TYPE &VAR4


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report This Post
Gold member
posted Hide Post
Not being nearly as clever as the previous posters, I typically cheat and use Javascript functions
for this type of parameter manipulation! The example below is what I use to get an in-list for use
with SQL (for example, 'A', 'B', 'C', 'D').

So if this is my function:

function fsuMultiSelectGetInList(selID, inputID) {
   var objSel = document.getElementById(selID);
   var objInput = document.getElementById(inputID);
   var objOpt;
   var i = 0;
   var strInList = "";
 
   for(i=0; i<objSel.options.length; i++) {
      objOpt = objSel.options[i];
 
      if(objOpt.selected) {
         if(strInList != "") {
            strInList += ", ";
         }
         strInList += "'" + objOpt.value + "'"
      }
   }
   objInput.value = strInList;
}


I would use it with an onChange event, like so:

      <!-- ***** Aid Type ***** -->
       <label class="three_col" id="lblAidType" for=selAidType>Aid Type:
          <SELECT class="three_col" id=selAidType tabIndex=4 size=3 multiple name=atyp_ind addalloption="1" selectedvalue datasource boundtovariable="1" requiredfield="1448346" datatype="0" sourcetype="typeFex" accept="0" onChange="fsuMultiSelectGetInList('selAidType', 'txtAidType');" >
          </SELECT>
       </label>
       <input id=txtAidType type="hidden" class="three_col" name=atyp boundtovariable="1" datatype="0" />
       <div class="break_div"></div>


And then I use the variable value from the hidden text box (&atyp) in my FEX, instead of the value from
the select object. The code could easily be adapted to your purpose by checking the length of each option
value and adding zeroes as necessary.

- Just another option for others who happen on the post!

Rob


WebFocus 8201m on Windows; App Studio 8201; Procedures: WebFocus with SQL; HTML Parameter Pages & Dashboard; Output: Excel, HTML, & PDF.
 
Posts: 88 | Location: MI | Registered: July 23, 2009Report This Post
Expert
posted Hide Post
And the code get smaller and smaller......


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Expert
posted Hide Post
Well, to go to rediculous lengths, how about this....

-SET &VAR1 = '''1'' OR ''3'' OR ''12'' OR ''640''';

-SET &STRIP1 = STRREP(&VAR1.LENGTH, &VAR1, 1, '''', 0, 'X', &VAR1.LENGTH, 'A&VAR1.LENGTH');
-SET &Len = (ARGLEN(&VAR1.LENGTH,&VAR1,'I3') - ARGLEN(&STRIP1.LENGTH,&STRIP1,'I3'))/2 * 25 ;
-SET &STRIP2 = 'FTOA(' | STRREP(&STRIP1.LENGTH, &STRIP1 , 4, ' OR ', 22,',''(F3L)'',''A3'') | FTOA(',&Len, 'A&Len.EVAL') || ',''(F3L)'',''A3'');';
-SET &VAR1L  = &STRIP2.EVAL
-TYPE &VAR1L


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Expert
posted Hide Post
Try a test with a single value less than 10 to really check the routine properly Frowner

I've changed my solution to this to solve the problem -

-DEFAULT &VAR4 = '';
-SET &VAR1 = '''1'' OR ''3'' OR ''12'' OR ''640''';
-SET &VAR1 = '''1''';
FILEDEF VARLIST DISK VARLIST.FTM
-RUN
-SET &VAR1 = &VAR1 | ' OR '''|'''';
-SET &VAR2 = STRREP(&VAR1.LENGTH,STRREP(&VAR1.LENGTH,&VAR1,1,'''',0,'x',&VAR1.LENGTH,'A&VAR1.LENGTH'),4,' OR ',4,'  '|HEXBYT(13,'A1')||HEXBYT(10,'A1'),&VAR1.LENGTH,'A&VAR1.LENGTH');
-WRITE VARLIST &VAR2 | '  '
-READ VARLIST NOCLOSE &VAR3.3
-REPEAT :Loop WHILE &IORETURN EQ 0;
-SET &VAR4 = IF &VAR3 EQ 0 THEN &VAR4 ELSE &VAR4||FPRINT(&VAR3,'I3L','A3');
-READ VARLIST NOCLOSE &VAR3.3
-:Loop
-TYPE &VAR4

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Virtuoso
posted Hide Post
If I use a multi-select control, by default I only get the first value selected. Must be something different I'm doing, however, getting to multiple values like that is actually quite easy!

Say the multi-select has a control named VAR (like in the other examples), then in your report you have a variable &VAR. This variable only contains the first value, bummer...

BUT, there is also a variable &VAR0 that tells the number of values and variables &VAR1...&VARn with each value.

So you can do something like this:
-REPEAT :LOOP FOR &N FROM 1 TO &VAR0
-SET &NEWVAR = EDIT(&VAR.&N, '999');
-:LOOP


Note that if there's only one value selected, the variables &VAR0..&VARn don't exist, so you'll have to work around that by, for example, defining default values for those variables.


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
 
Posts: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report This Post
Expert
posted Hide Post
quote:
Must be something different I'm doing

Have a look at the value for the attribute named "operation".

This is normally set to NONE in earlier releases (if I remember correctly) but could be changed to OR for the outcome mentioned by Lenny.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Virtuoso
posted Hide Post
Yes, but that requires the wildest string parsing in the OP's case, while the values are already separate in my case. I suspect that may be more convenient to the OP - which is why I mentioned it.

Knowing that the behaviour gets changed by that "operation" option is good to know, though, both for us and for the OP.


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
 
Posts: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report This Post
Silver Member
posted Hide Post
WOW! This is fascinating stuff!

Here I couldn't find one way to get this to work and I have numerous options of how to solve my dilemma. It's going to be a very exciting week working through all these ideas.

Thank you all so much!


WebFOCUS 8202M
Client: Windows Server 2012R2/Tomcat 8.0/IIS
Server: IBM i v7r2m0
MS-SQL
 
Posts: 28 | Location: Saskatchewan, Canada | Registered: March 03, 2011Report This Post
Expert
posted Hide Post
quote:
It's going to be a very exciting week

You need to get out more Wink

Mind you, you could say that about us all I suppose Frowner

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Expert
posted Hide Post
quote:
but that requires the wildest string parsing in the OP's case

In this case, yes I agree, but otherwise it depends upon how it's going to be used.

As implied by yours, and Robs responses (and of course others) the end requirement should be studied to decide which is the best point at which to do the processing best suited to the end requirement.

Like Rob, if I were writing this process, I would likely achieve it within the web page. But then that is only from information given within this post. If we knew (and had asked for) more information then that may change.

However, we need to remember that not all the members (and other viewers) of this forum are experienced in all aspects of developing a complete solution, and will consequently achieve it within the bounds of their own personal knowledge and ability.

I'm sure that the potential methods given here will help, not only Lenny, but many other visitors looking for a similar solution to a troublesome requirement.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Expert
posted Hide Post
quote:
Try a test with a single value less than 10 to really check the routine properly


The perils of RAD.

-SET &VAR1 = '''1'' OR ''3'' OR ''12'' OR ''640''';
-SET &VAR1 = &VAR1 ;
-SET &STRIP1 = STRIP(&VAR1.LENGTH, &VAR1,'''','A&VAR1.LENGTH') ;
-SET &Len = ((ARGLEN(&VAR1.LENGTH,&VAR1,'I3')) - ARGLEN(&STRIP1.LENGTH,&STRIP1,'I3'))/2 * 25 ;
-SET &STRIP2 = IF &STRIP1 CONTAINS ' OR '
-              THEN 'FTOA(' | STRREP(&STRIP1.LENGTH, &STRIP1 , 4, ' OR ', 22,',''(F3L)'',''A3'') | FTOA(',&Len, 'A&Len.EVAL') || ',''(F3L)'',''A3'');'
-              ELSE 'FTOA(' | &STRIP1 | ',''(F3L)'',''A3'');';
-SET &VAR1L  = &STRIP2.EVAL
-TYPE &VAR1L


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report 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] Manipulating values passed from multiselect control to fex

Copyright © 1996-2020 Information Builders