Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Return function ?

Asked by 10 years ago

if i put


print "Hi" Return

will it return to the top of the script?

also can i do this

print "THIS IS NOTHING"

print "Hi"

Return 

how do i make it return to the print"Hi" section and not the top?

1 answer

Log in to vote
1
Answered by 10 years ago

No, return is sort of like print so if i say

function addNumbers(num1, num2)
    return num1 + num2
end

a = addNumbers(3, 5)
print(a)

It will then print 8 The function becomes somewhat like a variable, holding the value(s) returned. Like this you can "set" a variable to what the function returns.

Ad

Answer this question