Focal Point
Strange effect from Functions

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

April 01, 2008, 05:20 AM
Tony A
Strange effect from Functions
Folks,

I have a current development where I need to perform a couple of repetative data manipulations. I decided to use functions for this as it could be useful across several reports.

The problem arises when I use two functions and the results I am getting are quite strange. If I use one or three functions then the results appear as expected, so it would appear that it is to do with just two functions.

Has anyone else experienced this?

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
April 01, 2008, 08:15 AM
GamP
Tony,

Coukd you give a code-example for this?
With input and expected output?

That would make it easier to try and understand your problem...


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
April 01, 2008, 08:38 AM
Tony A
GamP,

A bit late for this now of course, but here is a mock up -

APP PREPENDPATH IBISAMP
DEFINE FUNCTION MERGE_IT(X/A10, Y/A16, Z/A24)
  MERGE_IT/A10 = EDIT(X,'$$9$$') || EDIT(Z,'$$$$$$9$') || EDIT(Y,'$$$$$9$')
                 || EDIT(Z,'$$$$$$$9$$$$$$9$') || (' ' | EDIT(Y,'$$9$$$9$$9')) || EDIT(Y,'$9$');
END
DEFINE FUNCTION CHOOS_IT(X/A10, Y/A16, Z/A24)
  CHOOS_IT/A1 = IF ((X EQ 'ITALY') + (Y EQ 'ALFA ROMEO') + (Z CONTAINS 'SPIDER')) EQ 3 THEN 'Y' ELSE 'N';
END
-RUN
TABLE FILE CAR
PRINT COMPUTE CLONE_IT/A10 = MERGE_IT(COUNTRY, CAR, MODEL);
      COMPUTE SELECT/A1    = CHOOS_IT(COUNTRY, CAR, MODEL);
      COMPUTE DATE/DMtYY   = (RCOST * 2.95) + (DCOST * 3.36) + (SEATS * 18) + 1;
      COMPUTE TIME/I2      = EDIT(EDIT(HHMMSS('A8'),'99$'));
BY COUNTRY NOPRINT
BY CAR     NOPRINT
BY MODEL   NOPRINT
ON TABLE HOLD AS TEMP_HLD FORMAT FOCUS
ON TABLE SET HOLDLIST PRINTONLY
END
TABLE FILE TEMP_HLD
PRINT DATE AS '' CLONE_IT AS '' TIME NOPRINT
WHERE SELECT EQ 'Y'
WHERE DATE   EQ '&DMYY'
WHERE TIME   LE 12
ON TABLE HOLD FORMAT HTMTABLE AS CRASH
ON TABLE SET HTMLCSS ON
ON TABLE SET PAGE NOLEAD
ON TABLE SET STYLE *
  GRID=OFF, SIZE=48, $
  TYPE=DATA, CLASS=01_04_f0_01, $
ENDSTYLE
END
-RUN
-HTMLFORM BEGIN
<html>
<head>
<title>Believe it
</title>
</head>
<style>
 .01_04_f0_01 {font-size:48pts; color:#f00104;}
</style>
<body>
<center>
!IBI.FIL.CRASH;
</center>
</body>
</html>
-HTMLFORM END

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
April 01, 2008, 08:59 AM
mgrackin
Tony,

I can't believe I actually ran that code.

Roll Eyes Razzer Good One


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011
April 01, 2008, 08:59 AM
GamP
For me, it gives me an error message: test value inconsistent with format of field.
But then, I'm on 713 at this moment.

After changing the where date and where time to where total's the request ran fine.
Kinda like the red typing that is presented - Good one!

See you at summit ?


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
April 01, 2008, 09:07 AM
mgrackin
GamP,

I'm on 713 and ran it fine without adjustments.


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011
April 01, 2008, 09:14 AM
Tony A
GamP,

Yes, I'll be at Summit, look me up!

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
April 01, 2008, 10:44 AM
susannah
aaaaaaaaaaarrrrrrrrrrrrggggggggggggggggghhhhhhhhh
Fell for it.
Hook, line, and sinker.




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
April 01, 2008, 10:58 AM
Glenda
By the time I got to my email, several others had already responded so I new it was an April's Fool item. But I had to run the code any way to see the output. Good one.


Glenda

In FOCUS Since 1990
Production 8.2 Windows
April 01, 2008, 11:03 AM
Tony A
I even left clues for folks such as checking the current date and the hour being LE 12.

Another clue was the class within the style sheet as well as the hex colour code in the HTML.

Hope it gave you all a laugh, it was tough waiting for someone to take the bait Wink

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10