Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Simple Math - I hope
Go
New
Search
Notify
Tools
Reply
  
[SOLVED] Simple Math - I hope
 Login/Join
 
Member
posted
I'm not sure what I am doing wrong here, but I am doing something wrong. Any help would be appreciated. Here is the code:

-SET &STARTLEFT=IF &CNTRY_COUNT EQ 1 THEN 6.313
-ELSE IF &CNTRY_COUNT EQ 2 THEN 4.75
-ELSE IF &CNTRY_COUNT EQ 3 THEN 3.367;
-TYPE "STARTLEFT = " &STARTLEFT

-REPEAT :CTRYLOOP FOR &CNT FROM 1 TO &CNTRY_COUNT
-READ HDLVALS, NOCLOSE &LEVEL

-IF &LEVEL EQ '2' THEN GOTO LEVELTWO;
-IF &LEVEL EQ '3' THEN GOTO LEVELTHREE;

-TYPE "STARTLEFT = 1" &STARTLEFT
-SET &NEWSTART = (&STARTLEFT + 1.1983);
-SET &STARTLEFT = &NEWSTART;
-TYPE "STARTLEFT = 2" &STARTLEFT

-GOTO BOTTOMLOOP

-LEVELTWO

-TYPE "STARTLEFT = 3" &STARTLEFT
-SET &NEWSTART = &STARTLEFT.EVAL + 1.1983;
-SET &STARTLEFT = &NEWSTART.EVAL;
-TYPE "STARTLEFT = 4" &STARTLEFT

-GOTO BOTTOMLOOP

-LEVELTHREE

-TYPE "STARTLEFT = 5" &STARTLEFT
-SET &NEWSTART = &STARTLEFT.EVAL + 1.1983;
-SET &STARTLEFT = &NEWSTART.EVAL;
-TYPE "STARTLEFT = 6" &STARTLEFT
-GOTO BOTTOMLOOP

-BOTTOMLOOP

-:CTRYLOOP
-CLOSE HDLVALS

Here is the output:
"STARTLEFT = " 3.367
"STARTLEFT = 1" 3.367
"STARTLEFT = 2" 4
"STARTLEFT = 3" 4
"STARTLEFT = 4" 5
"STARTLEFT = 5" 5
"STARTLEFT = 6" 6

It seems to be rounding for me, what function am I missing?

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


DevStudio Version 7701
WebFocus 7.7 Windows Server 2003 PDF Format
 
Posts: 12 | Registered: October 08, 2010Reply With QuoteReport This Post
Virtuoso
posted Hide Post
Look up "SET DMPRECISION"
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Reply With QuoteReport This Post
Member
posted Hide Post
Thank You so much. That worked perfectly.


DevStudio Version 7701
WebFocus 7.7 Windows Server 2003 PDF Format
 
Posts: 12 | Registered: October 08, 2010Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Simple Math - I hope

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.