My Oracle Support Banner

IScript Function Call to strToLong Does Not Return Expected Result For Alphanumeric Input (Doc ID 1265576.1)

Last updated on OCTOBER 02, 2019

Applies to:

Oracle Communications Billing and Revenue Management - Version 7.3.0.0.0 and later
Information in this document applies to any platform.

Goal

How to workaround when function call strToLong does not return the expected result for alphanumeric input?

As per the document:
strToLong ---> This function converts a string value to a Long value.
Returns the string converted to a Long value if the function is successful.
Returns 0 if the string is not a valid Long value.

But after applying this function to the string "598*111" the return value its 598.
When the expected result its 0 for "598*111" as it's not a valid Long

e.g.
1) Provide the below iScript : (ISC_NAME.isc)


File out;
Long val;

if ( fileOpen (out, "<PIPELINE DIR>/test1.txt", "w" ) == true )
{
   fileWriteStr ( out, "Hello World!\n" );
   val = strToLong("598*111");
   fileWriteLong ( out, val );
}


under $IFW_HOME/iScriptLib/iScriptLib_Standard

2) start_ifw;stop_ifw

getting the below output :


HOSTNAME 156mui> cat test1.txt
Hello World!
598

Solution

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Goal
Solution

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.