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     SOLVED Determine if amper variable is integer or decimal value

Read-Only Read-Only Topic
Go
Search
Notify
Tools
SOLVED Determine if amper variable is integer or decimal value
 Login/Join
 
Member
posted
I have a focexec that requires the user to be prompted to enter an integer value for processing. I can successfully determine if the user enters non-numeric data and send an error message using the .TYPE suffix on the amper variable name on in IF statement. I cannot figure out how to determine in WebFOCUS whether they have entered a decimal value instead of an integer. It just accetps the decimal and truncates to an integer, but the user wants an error message if they enter a decimal instead of truncating. Anyone know a work around to make this determination?

This message has been edited. Last edited by: Mike Orefice,


7.6.4, WINXP
HTML, EXCEL, PDF.
 
Posts: 9 | Registered: July 09, 2009Report This Post
Virtuoso
posted Hide Post
Something like this maybe?
-SET &ER = 1009;
-TYPE &|AMPER.TYPE = &ER.TYPE

-SET &DECIMAL = IF &ER.TYPE EQ 'A' THEN '-'ELSE IF &ER CONTAINS '.' THEN 'Y' ELSE 'N';
-TYPE &|AMPER.DECIMAL = &DECIMAL

Hope this helps ...


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
 
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007Report This Post
Virtuoso
posted Hide Post
GamP already gave you a solution. Here's a little explanation. Dialogue Manager is not very good at determining the format of an amper variable. It can determine the difference between a number and an alpha string using the .TYPE operator like in the example. It cannot tell the difference between a decimal and an integer, so the easiest way is to treat it like a string and see if it contains a decimal point. You could also do some arithmetic operation to see if the value was equal to the INT(value).
I suppose from your description that you are using autoprompting. If you're needing to validate the formats of entered fields I would create a launch page and validate using a Javascript function before anything is submitted to the WF server for processing. That's kind of the standard way to handle this type of thing.


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
 
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007Report 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     SOLVED Determine if amper variable is integer or decimal value

Copyright © 1996-2020 Information Builders