Focal Point
(FOC36355) INVALID TYPE OF ARGUMENT #1 FOR USER FUNCTION FTOA

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/2901077602

January 12, 2007, 06:23 AM
tlbrydie2
(FOC36355) INVALID TYPE OF ARGUMENT #1 FOR USER FUNCTION FTOA
I am executing the attached procedure to prepare a line for printing
my data has mcstype's of - d:decmial, y:date, I:smallint h: datetime year to
minute, m:datetime hour to minute f:float c:character.varchar. I get the above
error as soon as the first "d" is encountered.

Any help would be greatly appreciated.

P.S. - to thoes I have not responded to...I'm still getting used to this system. seems like I can't respond to direct email from this forum (Thanks for the info Kerry)
------------------------------------------------



-SET &MCSBLANK = ' ';
-SET &MCSDESC = ' ';
-SET &MCSNAME = ' ';
-SET &MCSTYPE = ' ';
-SET &NUMOFCS=0;

-READ_MCS
-*this step reads the data from the webfocus screen mapping table into the variables
-READ RA1WFSMT &MCSBLANK &MCSDESC &MCSNAME &MCSTYPE
-IF &IORETURN NE 0 GOTO END_READ_MCS;

-SET &NUMOFCS=&NUMOFCS+1;

-SET &MCSDESC.&NUMOFCS = '&MCSDESC.EVAL';

-SET &MCSNAME.&NUMOFCS = IF &MCSTYPE.EVAL EQ 'C' THEN &MCSNAME.EVAL
- ELSE IF &MCSTYPE.EVAL EQ 'D' THEN 'FTOA('||&MCSNAME.EVAL||','||'''(D22.2)'''||',CSVALDIS)'
- ELSE IF &MCSTYPE.EVAL EQ 'Y' THEN 'CHGDAT('||'''YYMD'''||','||'''MDYY'''||','||&MCSNAME.EVAL||',CSVALDIS)'
- ELSE IF &MCSTYPE.EVAL EQ 'H' THEN 'HCNVRT('||&MCSNAME.EVAL||','||'''(HYYMD)'''||',30,'||'''A30'''||')'
- ELSE IF &MCSTYPE.EVAL EQ 'I' THEN 'EDIT('||&MCSNAME.EVAL||')'
- ELSE &MCSNAME.EVAL;
-*-TYPE &MCSNAME.&NUMOFCS
-SET &MCSTYPE.&NUMOFCS = '&MCSTYPE.EVAL';
-GOTO READ_MCS

-END_READ_MCS

JOIN jblank IN RA1WFSMT TO jblankp IN RA1PLOOK AS t1

DEFINE FILE RA1WFSMT
LN/I3 WITH jblank = LAST LN + 1;
CSCOLDIS/A50 = focus_desc;
CSVALDIS/A50 =

SET &CSLOOP = 0;
-MCSIFLOP
-IF &CSLOOP.EVAL GE &NUMOFCS.EVAL GOTO CSLOOPOT;
-SET &CSLOOP = &CSLOOP + 1;
-SET &MCSIF = 'IF num EQ '| &CSLOOP |' THEN '| &MCSNAME.&CSLOOP.EVAL;
-SET &MCSELSE = IF &CSLOOP.EVAL EQ 1 THEN ' ' ELSE 'ELSE';
&MCSELSE.EVAL &MCSIF.EVAL
-GOTO MCSIFLOP
-CSLOOPOT
ELSE ' ';
END




Prod: WebFOCUS 7.6.10 MRE
Oracle/Sybase
Test: DevStudio 7.6.6
WF Server 7.6.6
Report Caster 7.6.6
Web Server - Tomcat
MS Windows XP SP2
Output: HTML, Excel 2000 , PDF, CSV, DOC

January 12, 2007, 09:28 AM
FrankDutch
quote:
'FTOA('||&MCSNAME.EVAL||','||'''(D22.2)'''||',CSVALDIS)'


It is this part of the code that gives you the problem.
you want to convert a number to a string.

If you leave out that first test, does the function work?

I think this has something to do with the quotes.




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

January 12, 2007, 10:18 AM
tlbrydie2
yes this the portion of the code that is(was) causing the probled...I changed the function to ptoa and it seems to have gotten pase this point...could you tell me if I have the correct functions for the other data types?




Prod: WebFOCUS 7.6.10 MRE
Oracle/Sybase
Test: DevStudio 7.6.6
WF Server 7.6.6
Report Caster 7.6.6
Web Server - Tomcat
MS Windows XP SP2
Output: HTML, Excel 2000 , PDF, CSV, DOC