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     Strange effect from Functions
Go
New
Search
Notify
Tools
Reply
  
Strange effect from Functions
 Login/Join
 
Expert
posted
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 
 
Posts: 5667 | Location: United Kingdom | Registered: April 08, 2004Reply With QuoteReport This Post
Virtuoso
posted Hide Post
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 7 - IE11.
in Focus since 1988
 
Posts: 1960 | Location: Netherlands | Registered: September 25, 2007Reply With QuoteReport This Post
Expert
posted Hide Post
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 
 
Posts: 5667 | Location: United Kingdom | Registered: April 08, 2004Reply With QuoteReport This Post
Virtuoso
posted Hide Post
Tony,

I can't believe I actually ran that code.

Roll Eyes Razzer Good One


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011
 
Posts: 995 | Location: Gaithersburg, MD, USA | Registered: May 07, 2003Reply With QuoteReport This Post
Virtuoso
posted Hide Post
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 7 - IE11.
in Focus since 1988
 
Posts: 1960 | Location: Netherlands | Registered: September 25, 2007Reply With QuoteReport This Post
Virtuoso
posted Hide Post
GamP,

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


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011
 
Posts: 995 | Location: Gaithersburg, MD, USA | Registered: May 07, 2003Reply With QuoteReport This Post
Expert
posted Hide Post
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 
 
Posts: 5667 | Location: United Kingdom | Registered: April 08, 2004Reply With QuoteReport This Post
Expert
posted Hide Post
aaaaaaaaaaarrrrrrrrrrrrggggggggggggggggghhhhhhhhh
Fell for it.
Hook, line, and sinker.




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Reply With QuoteReport This Post
Guru
posted Hide Post
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
 
Posts: 301 | Location: Galveston, Texas | Registered: July 07, 2004Reply With QuoteReport This Post
Expert
posted Hide Post
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 
 
Posts: 5667 | Location: United Kingdom | Registered: April 08, 2004Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Strange effect from Functions

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