Function initialization at the first call.
- Posted by SnakeCharmer Jan 17, 2013
- 1228 views
For example, I need function for exctraction of values from some sequence. This sequence must be builded before any extractions (for example, filled with random data). How to do such initialization? I thought up only one way yet.
sequence String = "" function InitString() String = "I'm initialized now!" end function export function SymbolFromString(integer Position) if length(String) = 0 then InitString() end if return String[Position] end function