Editing Variables 0 You are not logged in. The rich text editor does not work with JavaScript switched off. Please either enable it in your browser options, or visit your preferences to switch to the old MediaWiki editor {{Needs Examples}} Variables are how FiM++ manages data in memory. There are three primitive data types, as well as arrays and custom objects. '''Variables''' are FiM++'s way of interacting with data in memory. == Types == There are three basic types of variables: * '''Boolean values''' represent exactly one of two possible values, such as "true/false", "yes/no", "on/off", "1/0", et cetera. They are stored in memory as a single bit. * '''numbers''' represent 64 bits of data, in IEEE 754 standard double-precision floating-point format. More information on this format can be found [[wikipedia:Double-precision floating-point format|on Wikipedia]] * '''characters''' represent UTF-8 data. Depending on the individual character, this can take up between 8 and 32 bits, inclusive. More information on this format can be found [[wikipedia:UTF-8|on Wikipedia]] == Declaration == * {{codeblock|{{code|keyword|Did you know that}}{{tag|whitespace}}{{tag|variable|name}}{{tag|punctuation}}}} * {{codeblock|{{code|keyword|Did you know that}}{{tag|whitespace}}{{tag|variable|name}}{{tag|whitespace}}{{tag|keyword|assign}}{{tag|whitespace}}{{tag|value}}{{tag|punctuation}}}} == Data Types == The following are all the primitive data types in FiM++: * Numbers ** Numbers are 64-bit (double-precision) floating point data types * Characters ** Characters are UTF-8 (up to 8 integer bytes) characters * Boolean values ** Boolean values are 1-bit binary values An array can be made of any variable using special keywords (usually, appending "s" or "es" onto a preexisting variable type keyword) == Names == Each variable name has the following restrictions: * Must not contain any [[reserved phrases]] ** However, literals are okay. Don't forget that this language is case-sensitive, so "{{code|variable|Twilight's {{codeerror|number}}}}" is bad, but "{{code|variable|Twilight's Number}}" is good. * Must not contain any [[punctuation]] * Must begin with one non-[[whitespace]], non-[[literal]] character * Must end with one non-whitespace character Each variable name also has the following freedoms: * There is no hard limit on the length * May have any whitespace character in them (yes, even new lines) * May contain literals, as long as they are not at the beginning of the name ** for instance, {{code|variable|cloud 9}} is okay, but not {{code|variable|{{codeerror|2}} princesses}} * May contain apostrophes * Encoded in UTF-8 == See Also == * [[Applejack's Hat]] {{Navbox/Keywords}} Loading editor Below are some commonly used wiki markup codes. Simply click on what you want to use and it will appear in the edit box above. Insert: – — … ° ≈ ≠ ≤ ≥ ± − × ÷ ← → · § Sign your username: ~~~~ Wiki markup: {{}} | [] [[]] [[Category:]] #REDIRECT [[]] <s></s> <sup></sup> <sub></sub> <code></code> <blockquote></blockquote> <ref></ref> {{Reflist}} <references/> <includeonly></includeonly> <noinclude></noinclude> {{DEFAULTSORT:}} <nowiki></nowiki> <!-- --> <span class="plainlinks"></span> Symbols: ~ | ¡ ¿ † ‡ ↔ ↑ ↓ • ¶ # ¹ ² ³ ½ ⅓ ⅔ ¼ ¾ ⅛ ⅜ ⅝ ⅞ ∞ ‘ “ ’ ” «» ¤ ₳ ฿ ₵ ¢ ₡ ₢ $ ₫ ₯ € ₠ ₣ ƒ ₴ ₭ ₤ ℳ ₥ ₦ № ₧ ₰ £ ៛ ₨ ₪ ৳ ₮ ₩ ¥ ♠ ♣ ♥ ♦ View this template This field is a spam trap. DO NOT fill it in! Edit summary Preview Mobile Desktop Show changes