TABLE FILE FDATA PRINT GETUSERID WHERE TYPE EQ 'EMAIL'; WHERE GETUSERID EQ LOCASE(8,'&LOGASS','A8'); ON TABLE PCHOLD FORMAT PDF END -RUN
I am getting an error saying (FOC003) THE FIELDNAME IS NOT RECOGNIZED: GETUSERID
Suggestions?
Kymber
July 16, 2008, 04:31 PM
Francis Mariani
You will have an error before the "(FOC003) THE FIELDNAME IS NOT RECOGNIZED: GETUSERID" error - only the first error is valid.
.LENGTH only works in Dialogue Manager. In FOCUS code, you have to specify the length as a numeric value:
DEFINE FILE CAR
EMAILUSERID/A30 = 'THIS.IS@TEST.COM';
GETUSERID/A30 = GETTOK(EMAILUSERID, 30, 1,'@', 30, GETUSERID);
END
-RUN
TABLE FILE CAR
PRINT
GETUSERID
COUNTRY
END
-RUN
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
July 16, 2008, 04:36 PM
Kymber
SOLUTION:
I hard coded the EMAILUSERID.LENGTH to 30 and I got the correct results.
... In FOCUS code, you have to specify the length as a numeric value
No longer true.
DEFINE FILE CAR
-* highjack a field to hold the email address:
STANDARD= EDIT(MODEL,'9.gross@midwoodds.com');
-* these calls are invarient w/r/t change in declared length of the STANDARD field:
USERID/A20 = GETTOK(STANDARD, LENV(STANDARD,'I2'), 1,'@', 20, USERID);
DOMAIN/A20 = GETTOK(STANDARD, LENV(STANDARD,'I2'), 2,'@', 20, DOMAIN);
END
TABLE FILE CAR
WRITE USERID DOMAIN
BY CAR BY MODEL BY STANDARD
END
LENV() was introduced with varchar (AnV) fields, to provide access to the 'length of content' -- but it also accepts char (An) fields, returning the declared length.
This is useful for database fields whose length may be subject to change, and with 'A0' formal arguments in Maintain functions.