File: Treating_Variables_as_Strings.html

package info (click to toggle)
sludge 2.2-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 6,820 kB
  • sloc: cpp: 31,960; sh: 1,037; xml: 874; makefile: 672
file content (118 lines) | stat: -rwxr-xr-x 2,436 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<TITLE>Treating Variables as Strings</TITLE>
  <link rel="stylesheet" type="text/css" href="style.css" />
</head>
<BODY>
<HR>
<div align="center"><img id="headerGraphic" src="images/sludge300.png" alt="SLUDGE"/></div>
<h2>Treating Variables as Strings</h2>
<HR>


<P>
You can treat any variable as a string... that means these things are all allowed:
</P>

<P>
<pre>say (ego, myVariable);

newVariable = &quot;The name of the ego character is \&quot;&quot; + ego + &quot;\&quot;.&quot;;

statusText (57219);</pre>
</P>

<P>
Here's what you'll get when using each of the data types as a string.
</P>

<P>
<B>Undefined:</B>
</P>

<P>
Always equates to &quot;undefined&quot;.
</P>

<P>
<B>Numbers:</B>
</P>

<P>
Equates to the decimal representing the number, as you'd expect, complete with minus sign if required.
</P>

<P>
<B>Strings:</B>
</P>

<P>
Equates to the current value of the string. Oddly.
</P>

<P>
<B>File handles:</B>
</P>

<P>
If the game has been compiled in development mode, equates to the original name of the resource file. Otherwise, equates to &quot;file handle&quot;.
</P>

<P>
<B>Object types:</B>
</P>

<P>
Equates to the on-screen name of the object type.
</P>

<P>
<B>Stacks:</B>
</P>

<P>
Equates to the string representation of each element, separated by a comma and a space. If the stack is empty, equates to &quot;empty stack&quot;.
</P>

<P>
<B>Function handles:</B>
</P>

<P>
Equates to &quot;pointer to function&quot; if the function is user-defined or &quot;pointer to BIF&quot; if the pointer is built-in (ie. one of the functions in the <a href="Alphabetical_List_of_Built-in_Functions.html">Alphabetical List of Built-in Functions</a> section).
</P>

<P>
<B>Animations:</B>
</P>

<P>
Aliays equates to &quot;animation&quot;.
</P>

<P>
<B>Costume:</B>
</P>

<P>
Always equates to &quot;costume&quot;.
</P>


<H3>See also:</H3>

<P>
<a href="Variable_Operations.html">Variable Operations</a>
</P>

<P>
<a href="Spellchecking_the_Strings_in_your_Game.html">Spellchecking the Strings in your Game</a>
</P>

<P class="copyright-notice">SLUDGE and this SLUDGE documentation are <A HREF="Copyright.html">copyright</A> Hungry Software and contributors 2000-2012
</P>

<HR>
</BODY>
</html>