Nasal Hello World: Difference between revisions
Jump to navigation
Jump to search
Red Leader (talk | contribs) No edit summary |
Red Leader (talk | contribs) (A few more edits, inc. comment out stuff on strings which doesn't belong here) |
||
Line 1: | Line 1: | ||
{{Nasal Navigation}} | {{Nasal Navigation}} | ||
In the programming world, a "Hello, World!" program is used to illustrate basic syntax using a very simple program. The '''"Hello, World!" program in [[Nasal]]''' would look like this: | In the programming world, a {{wikipedia|"Hello, World!" program}} is used to illustrate basic syntax using a very simple program. The '''"Hello, World!" program in [[Nasal]]''' would look like this (run this in the [[Nasal Console]]): | ||
<syntaxhighlight lang="nasal"> | <syntaxhighlight lang="nasal"> | ||
print( | print("Hello World!"); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
This will | This will print the string <code>Hello, World!</code> into the console. | ||
<!-- | |||
Strings in Nasal can also use double quotes which support escaping: | Strings in Nasal can also use double quotes which support escaping: | ||
<syntaxhighlight lang="nasal"> | <syntaxhighlight lang="nasal"> | ||
Line 42: | Line 41: | ||
Nasal strings are always arrays of bytes (never characters: see the utf8 library if you want character-based equivalents of substr() et. al.). They can be indexed just like in C (although note that there is no nul termination -- get the length with size()): | Nasal strings are always arrays of bytes (never characters: see the utf8 library if you want character-based equivalents of substr() et. al.). They can be indexed just like in C (although note that there is no nul termination -- get the length with size()): | ||
--> |
Revision as of 08:07, 19 October 2016
The FlightGear forum has a subforum related to: Nasal Scripting |
Nasal scripting |
---|
Nasal internals |
---|
Memory Management (GC) |
In the programming world, a "Hello, World!" program is used to illustrate basic syntax using a very simple program. The "Hello, World!" program in Nasal would look like this (run this in the Nasal Console):
print("Hello World!");
This will print the string Hello, World!
into the console.