Focal Point
[CLOSED] String to Integer

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

November 21, 2013, 09:02 AM
Piter
[CLOSED] String to Integer
Sorry for such simple question - Is there any function that translates string to Integer?

I have &Rec='10'. I need to have 10 in &Re_P. How I can do it?

This message has been edited. Last edited by: <Kathryn Henning>,


Wf7704/WF8,Win64/32
November 21, 2013, 09:59 AM
Dave
Piter,

look up these functions:

EDIT
or
ATODBL

G'luck,
Dave


_____________________
WF: 8.0.0.9 > going 8.2.0.5
November 21, 2013, 10:09 AM
Piter
quote:
ATODBL

I have tried EDIT(&Rec,'999') bit it returns AXX format? I am wrong? It seems EDIT works in DEFINE, but it does not work in -SET ?

I will try ATODBL


Wf7704/WF8,Win64/32
November 21, 2013, 10:52 AM
Francis Mariani
In Dialogue Manager, a string that is set with quotes is automatically treated as integer - if the value is numeric.

Try this simple test:

-SET &REC = '10';

-SET &RES = &REC * 5;

-TYPE &RES



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
November 21, 2013, 11:21 AM
Piter
Thank you Francis


Wf7704/WF8,Win64/32
November 25, 2013, 04:13 PM
Waz
Another option is:
-SET &REC = '10';
-SET &RES = &REC.EVAL ; 



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!

November 25, 2013, 04:19 PM
susannah
and EDIT in a DEFINE , if you just want a number out of a text, there's no mask
FRED/I5 = EDIT ( '12345');
or
ETHEL/A5 = '12345';
FRED/I5 = EDIT(ETHEL);




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID