ScriptBasic
February 09, 2012, 07:20:14 PM
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News
: The ScriptBasic User, Developer and extension module guides are available at the
WIKI
.
Home
Wiki
Help
Search
Login
Register
ScriptBasic
>
ScriptBasic
>
Tutorials
>
Calling functions and subs implicity
Pages: [
1
]
« previous
next »
Print
Author
Topic: Calling functions and subs implicity (Read 766 times)
support
Administrator
Posts: 369
Calling functions and subs implicity
«
on:
October 08, 2009, 10:51:58 AM »
SB allows you to pass addresses of functions/subs to other functions and call them implicitly within the function with
ICALL
.
Code:
FUNCTION addone(x)
addone = x + 1
END FUNCTION
FUNCTION x10(y)
x10 = y * 10
END FUNCTION
FUNCTION printit(v,a)
LOCAL r
r = ICALL(a,v)
PRINT r,"\n"
END FUNCTION
f1 = ADDRESS(addone())
f2 = ADDRESS(x10())
printit(1,f1)
printit(1,f2)
C:\scriptbasic\test>icall
2
10
C:\scriptbasic\test>
Logged
Pages: [
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
Open Forum
-----------------------------
=> Round Table
=> What's New
-----------------------------
ScriptBasic
-----------------------------
=> Download
=> Tutorials
=> Wish List
-----------------------------
Support
-----------------------------
=> General Discussions
=> Installation
=> ScriptBasic Examples w/source
=> Debugger
=> Source
=> Documentation
-----------------------------
Extension Modules
-----------------------------
=> Extension Modules
===> Curl
===> mxml
===> IUP
===> CGI
===> MySQL
===> ODBC
===> Berkeley DB
===> PSQL
===> GSL
===> Rlib
===> GTK-Server
===> CIO
===> NT
===> DYC
===> ZLIB
===> RE
===> HASH
===> GD
===> MT
===> T
===> DBG
Loading...