L3DT users' wiki
Large 3D terrain generator

Strings

Literal strings

Arguments in ZeoScript are delimited by spaces. Hence, any string argument that contains a space will be split into separate strings. To prevent string splitting, you should surround your string in “quotation marks”. Here is an example:

project.SaveProjectAs "C:\\temp\\this is a temp project name.proj"

String concatenation

Two strings may be concatenated together using the strcat function. More strings may be added by nesting calls to strcat, as below:

// create a new string for name
string MyName

// allow user to edit name
EditUI &MyName "Please enter your name"

// add strings together ("Hello " + MyName + "!"), and echo to screen
echo <strcat "Hello " <strcat MyName "!">>

The output of this script is:

Hello Aaron!

String lengths

The length of a string may be determined using the strlen function, as demonstrated below:

string s
int i

// initialise a string
set s "This text is 31 characters long"

// get the text length using 'strlen'
set i <strlen s>

// report the text length
echo i

The output of this script is:

31
 
plugins/general/zeoscript/reference/types/strings.txt · Last modified: 2017/08/31 05:34 (external edit)
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki