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.
Where COD_CENRES1 is a P7 format, and when I do the EDIT, it transforms to a number, so, if the packet of 7, is "12345", the nes COD_CENRES1 becomes 0012345, and in the Javascript function doesn´t crash, but takes this like an octal value.
Is there someway that COD_CENRES could be an integer without zeros?
Dunno if I have explained myself in a good way, I'm from Spain, and don't speak frequently English
RegardsThis message has been edited. Last edited by: Kerry,
____________________________________________ Ruben Rueda Consultant Information Builders Iberica
Mmm, ok, with that conversions I have a string, but what I want to do is to convert that string to integer, but the problem is if I use the EDIT function with that string generated, it creates a integer but it fills with zeros if the string coverted doesn't have the length I put, I mesn:
Using the edit function on a numeric value will add the leading zeroes (as you have experienced) and provide you with an alphanumeric value. You have to have an alphanumeric value because you are including it into an alphanumeric DEFINE as you have discovered. That is why FTOA is the way to provide what you require.
Using FTOA will convert a floating point decimal value to an alphanueric value without those annoying leading zeroes. Once you have the result of the FTOA function you can include that in your DEFINE without the EDIT.
Using COD_CENRES_INT/I7 = EDIT(COD_CENRES1_A); should give you the result 123 in your example and not the leading zeroes unless you have SET LEADZERO=ON elsewhere in your fex.
Consider -
DEFINE FILE CAR
COD_CENRES1/P7 = 123;
COD_CENRES1_F/F7 = COD_CENRES1;
COD_CENRES1_A/A7 = FTOA(COD_CENRES1_F,'(F7)','A7');
COD_CENRES1_I/I7 = EDIT(COD_CENRES1_A);
IDNOMBRE/A200='<a href=javascript:cargaDatos("' |
COD_CENRES1_A | '","' | COD_CENRES1_A | '")>' | COD_CENRES1_A | '</a>';
END
TABLE FILE CAR
PRINT COD_CENRES1 AS 'Packed'
COD_CENRES1_F AS 'Float'
COD_CENRES1_A AS 'Alpha'
COD_CENRES1_I AS 'Integer'
IDNOMBRE
BY COUNTRY NOPRINT
IF RECORDLIMIT EQ 1
END
Copy and paste this into a new fex and run it. The output is -
If I display these fields, FOCUS shows the values ok, but in Javascript not, why? I get in the second parameter some **** characters and doesn't look like that the function works properly.
This message has been edited. Last edited by: Kerry,
____________________________________________ Ruben Rueda Consultant Information Builders Iberica
Read my last post and you will have your solution - i.e. get rid of the parseInt function in your JavaScript call, you do not need it. Just get rid of the double quotes around your second parameter.
Use "hard concatenation" instead of "soft concatenation" to eliminate leading spaces in Dialog Manager variables.This message has been edited. Last edited by: Francis Mariani,
Francis
Give me code, or give me retirement. In FOCUS since 1991
Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
At this moment I've been able to pass parameters ok, the solution I adopted is a mix of what we have written before.
Here goes:
My problem was calling a function in javascript created in a define table, one parameter must be alpha and the other one must be integer, but with several conversion, Javascript didn't transform any integer 00XXXX because of Javascript taked this value like octal.
So, the solution was trasnfors COD_CENRES1 from P7 to A7, after this, in the define I already can call parseInt Javascript function form transform an alphanumerical value to integer in base 10, since Javascript was playing in base octal, so the result is:
IDNOMBRE/A200=ID|'<a href="javascript:cargaDatos('''|COD_NIVEL|''',
parseInt('''|EDIT(COD_CENRES1)|''',10))">' | NOMBRE | '</a>';
Hope it helps in the future all this
Thanks to everybody who helped me and give some ideas to this, many many thanksThis message has been edited. Last edited by: Kerry,
____________________________________________ Ruben Rueda Consultant Information Builders Iberica