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.
I pass an amount (dial. mgr. variable &SAMNT) into a fex via HTML (format on the final database is D15.2). I want to control the data entry so there must be no more than 2 dec. places and the number range is between -99,999,999,999.99 and 999,999,999,999.99
On the HTML page I have restricted characters entered to just 0 1 2 3 4 5 6 7 8 9 - . using Javascript.
Sadly the .TYPE test on Dial. Mgr. variable &SAMNT only allow numbers up to 10 to the power 9 - 1 ie. 999999999 This means that if they enter 123456789012.99 it fails the numeric test – if you see my code below you’ll get an idea of what I am trying to do.
-IF &SAMNT.TYPE NE 'N' THEN GOTO CONT3; -IF &SAMNT OMITS '.' THEN GOTO CONT4; -SET &POS_DECPT = POSIT(&SAMNT, &SAMNT.LENGTH, '.', '1', 'I8'); -SET &NOPLACES = &SAMNT.LENGTH - &POS_DECPT; -IF &NOPLACES GT 2 THEN GOTO CONT3 ELSE GOTO CONT4; -RUN -CONT3 -TYPE You must enter a valid Amount with a maximum of 2 dec. places -EXIT
-CONT4 -TYPE No. OK -EXITThis message has been edited. Last edited by: Ian Dalton,
_______________________ *** WebFOCUS 8.1.05M ***
Posts: 196 | Location: London, UK | Registered: December 06, 2005
For clarification purposes, why not check for a valid number range on the client (with JavaScript)?This message has been edited. Last edited by: David Briars,
Yes we could do David but this would mean changing loads of .html programs to keep our code etc. consistent across all applications which we don't want to do. We use WebFOCUS to do this.
_______________________ *** WebFOCUS 8.1.05M ***
Posts: 196 | Location: London, UK | Registered: December 06, 2005
Tom, I beg to differ. If I code the following below, ie. a no. with a dec. point, it works for 999.99 but not for 9999999999.99 -SET &ECHO=ALL; -SET &SAMNT=9999999.99; -TYPE &SAMNT &SAMNT.TYPE &SAMNT.LENGTH
The reason we do the check is that the string coming across may be 999....99 or ---99.99 I can tighten up the input via Javascript as David mentioned, by using the IsNan function for example, but it would be good to be able to do this validation within WebFOCUS.
_______________________ *** WebFOCUS 8.1.05M ***
Posts: 196 | Location: London, UK | Registered: December 06, 2005
Many thanks David - works well and funnily enough Alan B did reply to me privately with the follwing which does what I need also..... -* Alan B's solution...... DEFINE FUNCTION TEST(NUMBER/A20) FUNC1/A32 = IF NUMBER CONTAINS '.' THEN GETTOK(NUMBER, 20, -1, '.', 20, 'A20') ELSE ' '; FUNC2/A32 = IF NUMBER CONTAINS '.' THEN GETTOK(NUMBER, 20, 1, '.', 32, 'A20') ELSE NUMBER; TEST/A1 = IF ARGLEN(20, FUNC1, 'I9') GT 2 THEN 'N' ELSE IF (ATODBL(NUMBER, '20', 'D20.2') LT -99999999999.99 OR ATODBL(NUMBER, '20', 'D20.2') GT 999999999999.99) THEN 'N' ELSE 'Y';