Friday, 13 September 2013

OPL namespace printing output on the screen

OPL namespace printing output on the screen

i was looking at ILOG IBM help and came across below section. i am not
sure what the OPL namespace mean. how can run below example in my ibm ilog
screen?
length
Purpose OPL function to return the number of characters of a string.
Type:int
Syntax:length(string s)
Description: Returns the number of characters in the string s. You can use
this function within IBM® ILOG Script statements by specifying the OPL
namespace:
( Opl.xxx() )
Example
string s="Paris";
int l=length(s);
execute
{
writeln("length(\"",s,"\") gives ",l);
}
Result
length("Paris") gives 5

No comments:

Post a Comment