Debian Codegraph @

Docs/src/string.but

raw
1 \S1{stringinst} String Manipulation Instructions
2
3 \S2{StrCpy} StrCpy
4
5 \c user_var(destination) str [maxlen] [start_offset]
6
7 Sets the user variable $x with str. str can contain variables (including the user variable being set (concatenating strings this way is possible, etc)). If maxlen is specified, the string will be a maximum of maxlen characters (if maxlen is negative, the string will be truncated abs(maxlen) characters from the end). If start_offset is specified, the source is offset by it (if start_offset is negative, it will start abs(start_offset) from the end of the string).
8
9 \c StrCpy $0 "a string" # = "a string"
10 \c StrCpy $0 "a string" 3 # = "a s"
11 \c StrCpy $0 "a string" -1 # = "a strin"
12 \c StrCpy $0 "a string" "" 2 # = "string"
13 \c StrCpy $0 "a string" "" -3 # = "ing"
14 \c StrCpy $0 "a string" 3 -4 # = "rin"
15 \c StrCpy $0 "$0$0" # = "rinrin"
16
17 \S2{StrLen} StrLen
18
19 \c user_var(length output) str
20
21 Sets user variable $x to the length of str.
22
23 \c StrLen $0 "123456" # = 6