Call

From Kolmafia
Revision as of 16:21, 6 May 2010 by imported>StDoodle (Created page with 'Syntax: call [''type''] <identifier>( param, ... ); : ''type'' is an optional parameter which must match the return value of the function. If not specified, ''type'' defaul…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Syntax: call [type] <identifier>( param, ... );

type is an optional parameter which must match the return value of the function. If not specified, type defaults to void.

For instance:

int foo( int a, int b )
{
  return a + b;
}

String a = "foo";

float c = call float a( 2, 3 );

print( "c = " + c );

a = "hello world";

call a( "print 1" );

print( "done" );

will output the following to the CLI:

c = 5.0
hello world
done