Function initialization at the first call.

new topic     » topic index » view thread      » older message » newer message

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 
new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu