Sambar Server Documentation
|
CScript Constants |
Octal constants are written with a leading zero, i.e. 015. Hexadecimal constants are written with a leading 0x, i.e. 0x1ae. Character constants are usually just the character enclosed in single quotes; 'a', 'b', 'c'. Some characters can't be represented in this way, so a 2 character sequence is used:
A string constant is surrounded by double quotes, e.g. "Sambar Server". The string is actually stored as an array of characters. The NULL character '\0' is automatically placed at the end of such a string; this acts as a string terminator.
'\n' newline '\t' tab '\\' backslash '\'' single quote '\0' NULL
Below are some examples of other types of constants:
Note: An integer starting with a zero is assumed to be octal, unless the character after the zero is an 'x' or 'X', in which case the number is assumed to be in hexadecimal.
int 123, -1, 2147483647, 040 (octal), 0xab (hexadecimal) double 1.23, 3.14e+0f
Hex | Octal | ASCII | Hex | Octal | ASCII | Hex | Octal | ASCII | Hex | Octal | ASCII | Hex | Octal | ASCII | Hex | Octal | ASCII |
21 | 041 | ! | 22 | 042 | " | 23 | 043 | # | 24 | 044 | $ | 25 | 045 | % | 26 | 046 | & |
27 | 047 | ' | 28 | 050 | ( | 29 | 051 | ) | 2a | 052 | * | 2b | 053 | + | 2c | 054 | , |
2d | 055 | - | 2e | 056 | . | 2f | 057 | / | 30 | 060 | 0 | 31 | 061 | 1 | 32 | 062 | 2 |
33 | 063 | 3 | 34 | 064 | 4 | 35 | 065 | 5 | 36 | 066 | 6 | 37 | 067 | 7 | 38 | 070 | 8 |
39 | 071 | 9 | 3a | 072 | : | 3b | 073 | ; | 3c | 074 | < | 3d | 075 | = | 3e | 076 | > |
3f | 077 | ? | 40 | 100 | @ | 41 | 101 | A | 42 | 102 | B | 43 | 103 | C | 44 | 104 | D |
45 | 105 | E | 46 | 106 | F | 47 | 107 | G | 48 | 110 | H | 49 | 111 | I | 4a | 112 | J |
4b | 113 | K | 4c | 114 | L | 4d | 115 | M | 4e | 116 | N | 4f | 117 | O | 50 | 120 | P |
51 | 121 | Q | 52 | 122 | R | 53 | 123 | S | 54 | 124 | T | 55 | 125 | U | 56 | 126 | V |
57 | 127 | W | 58 | 130 | X | 59 | 131 | Y | 5a | 132 | Z | 5b | 133 | [ | 5c | 134 | \ |
5d | 135 | ] | 5e | 136 | ^ | 5f | 137 | _ | 60 | 140 | ` | 61 | 141 | a | 62 | 142 | b |
63 | 143 | c | 64 | 144 | d | 65 | 145 | e | 66 | 146 | f | 67 | 147 | g | 68 | 150 | h |
69 | 151 | i | 6a | 152 | j | 6b | 153 | k | 6c | 154 | l | 6d | 155 | m | 6e | 156 | n |
6f | 157 | o | 70 | 160 | p | 71 | 161 | q | 72 | 162 | r | 73 | 163 | s | 74 | 164 | t |
75 | 165 | u | 76 | 166 | v | 77 | 167 | w | 78 | 170 | x | 79 | 171 | y | 7a | 172 | z |
7b | 173 | { | 7c | 174 | | | 7d | 175 | } | 7e | 176 | ~ |
__FILE__ The name of the script file presently being executed. If used within a file which has been included, then the name of the included file is given, and not the name of the parent file. __LINE__ The number of the line within the current file which is being parsed. If used within a file which has been included, then the position within the included file is given. __MEMORY__ The amount of memory consumed thus far in the program. __CALLDEPTH__ The call depth of the program at this point in the execution. __STATEMENTS__ The number of statements executed so far in the program. TRUE A true value (integer 1). FALSE A false value (integer 0). NULL The NULL value.
© 2001 Sambar Technologies. All rights reserved. Terms of Use.