We have a HTML page that allows a user to select mutiple selections of an AGENT value. Values are 0000, 0010, 0020, etc.. In the following example, the fex variable value for AGENT is '0000' OR '0010' or '0020' as expected for a multiple select listbox.
I'm trying to use STRREP to change the 0000 value of the string to TOT for heading display.
Translated: STRREP(26, '0000' OR '0010' OR '0020', 4, '0000', 3, 'TOT', 26, 'A26');
The problem seems to be the use of numbers in the searchstring paramter (4) of the STRREP function. Does anyone know what this issue is or how to replace the 0000 value to TOT.
I use the STRREP function regularly, but have never needed to replace numbers within a string just characters.
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2
WebFOCUS App Studio 8.2.06 standalone on Windows 10
July 02, 2008, 03:54 AM
Danny-SRL
fmi,
Beware of the case where your user will choose only '0000'! The function will not like to have &agent be 0000 because it will be a number and not a string.
Daniel In Focus since 1982 wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF
July 02, 2008, 04:23 AM
Alan B
Danny
You are right if this were to come across as just 0000, but as this is being passed from a multi-select, it should always have single quotes around it, in which case it is viewed as an alpha field, as what the function sees is: STRREP(06, '0000', 4, '0000Z', 3, 'TOT', 06, 'A06'); which is acceptable to it.
Alan. WF 7.705/8.007
July 03, 2008, 10:50 AM
dcj
Thanks to everyone, I saw that it didn't work with a single select and below is how I handle it.
-SET &lagent = IF &lagent EQ 0000 THEN TOT ELSE &lagent;