Difference between revisions of "Loadstring"

From GiderosMobile
Line 5: Line 5:
 
To load and run a given string, use the idiom  
 
To load and run a given string, use the idiom  
  
     [[assert(loadstring(s))()]]
+
     [[Special:MyLanguage/assert(loadstring(s))()|assert(loadstring(s))()]]
  
 
Chunkname is used as the chunk name for error messages and debug information. When absent, chunkname defaults to the given string.</translate>
 
Chunkname is used as the chunk name for error messages and debug information. When absent, chunkname defaults to the given string.</translate>

Revision as of 17:33, 23 August 2018

Available since: Gideros 2011.6

Description

Gets the chunk from the given string. To load and run a given string, use the idiom

    assert(loadstring(s))()

Chunkname is used as the chunk name for error messages and debug information. When absent, chunkname defaults to the given string.

(function) = loadstring(string,chunkname)

Parameters

string: (string) string to load and compile
chunkname: (string) is used as the chunk name for error messages and debug information. optional

Return values

Returns (function) compiled chunk as a function; otherwise, returns nil