Call a function: Difference between revisions
Content added Content deleted
No edit summary |
|||
Line 2,424: | Line 2,424: | ||
rc=44 (Function or message did not return data) |
rc=44 (Function or message did not return data) |
||
fb cannot be invoked as function (it does not return a value)</pre> |
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}}== |
=={{header|Ruby}}== |