Jump to content

Call a function: Difference between revisions

no edit summary
No edit summary
Line 2,424:
rc=44 (Function or message did not return data)
fb cannot be invoked as function (it does not return a value)</pre>
 
=={{header|Ring}}==
<lang ring>
hello()
func hello
see "Hello from function" + nl
</lang>
<lang ring>
first() second()
func first see "message from the first function" + nl
func second see "message from the second function" + nl
</lang>
<lang ring>
sum(3,5) sum(1000,2000)
func sum x,y see x+y+nl
</lang>
<lang ring>
# this program will print the hello world message first then execute the main function
See "Hello World!" + nl
func main
see "Message from the main function" + nl
</lang>
 
=={{header|Ruby}}==
Cookies help us deliver our services. By using our services, you agree to our use of cookies.