Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     DEFINE FUNCTION with variable length return

Read-Only Read-Only Topic
Go
Search
Notify
Tools
DEFINE FUNCTION with variable length return
 Login/Join
 
Master
posted
Trying to write function using DEFINE FUNCTION

NOCRLF(inlen,indata) to remove CR and LF

eg CLEANSTR/A67 = NOCRLF(67,PART_NO) ;

Cannot see how to code a variable return format eg for TEMP and NOCRLF

DEFINE FUNCTION NOCRLF(INLEN, INDATA/A256) ;
TEMP/A67 = STRREP (INLEN,INDATA, 1, HEXBYT(13, 'A1'), 1, ' ',INLEN, TEMP);
NOCRLF/A67 = STRREP(INLEN,TEMP, 1, HEXBYT(10, 'A1'), 1, ' ', INLEN, NOCRLF);
END

Anybody know how to do this?



Server: WF 7.6.2 ( BID/Rcaster) Platform: W2003Server/IIS6/Tomcat/SQL Server repository Adapters: SQL Server 2000/Oracle 9.2
Desktop: Dev Studio 765/XP/Office 2003 Applications: IFS/Jobscope/Maximo
 
Posts: 888 | Location: Airstrip One | Registered: October 06, 2006Report This Post
Expert
posted Hide Post
John,

I posted a function that managed this a while back (here). It was in response to get the RIGHT n characters from a string but it should give you some syntactical ideas?

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: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Virtuoso
posted Hide Post
John,

Since you don't know the length of your input string you could use a variable length string. See this example:
  
-* File deffunc.fex
DEFINE FUNCTION NOCRLF(INLEN/I3, INDATA/A255) 
TEMP/A255 = STRREP (INLEN,INDATA, 1, HEXBYT(13, 'A1'), 1, ' ',INLEN, TEMP);
NOCRLF/A255V = STRREP(INLEN,TEMP, 1, HEXBYT(10, 'A1'), 1, ' ', INLEN, NOCRLF);
END

DEFINE FILE CAR
MODEL_BODY/A40=MODEL || HEXBYT(13,'A1') || HEXBYT(10,'A1') || BODYTYPE;
END

TABLE FILE CAR
PRINT MODEL_BODY
BY COUNTRY
BY CAR
ON TABLE HOLD 
END
SAVE AS SAVECRLF
!TYPE SAVECRLF.FTM
-RUN
DEFINE FILE HOLD
TEMP/A40=NOCRLF(40, MODEL_BODY);
END
TABLE FILE HOLD
PRINT TEMP
BY COUNTRY
BY CAR
ON TABLE SAVE
END
-RUN 
!TYPE SAVE.FTM


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     DEFINE FUNCTION with variable length return

Copyright © 1996-2020 Information Builders