User Tools

Site Tools


script:walkthrough:miscellaneous

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
script:walkthrough:script_return_value [2019-11-21 05:38] – [Other use cases] skyjakescript:walkthrough:miscellaneous [2019-11-21 05:39] (current) – ↷ Page name changed from script:walkthrough:misc to script:walkthrough:miscellaneous skyjake
Line 1: Line 1:
 +<- Scopes ^ ^ ->
 +
 +====== Miscellaneous ======
 +
 +===== Script return value =====
 +
 +In certain circumstances, it is useful to return a value from the entire script itself, and not just from a function. For example, the argument to ''eval()'' is a script whose return value is returned to the caller.
 +
 +The script return value is the final evaluated expression of the script.
 +
 +  if True
 +      "I am the return value."
 +  else
 +      "I could be, too."
 +  end
 +
 +
  
script/walkthrough/miscellaneous.txt · Last modified: 2019-11-21 05:39 by skyjake