Print

Input and Output
Aptilis 1

Print(Expr1, Expr2, Variable1, Variable2, etc...)

Print outputs expressions or variables to the standard output. (That's the screen when used from a console or DOS screen, or the web page returned after a form has been submited to an aptilis programme from the Web.)
Remember to add a '$' (Dollar sign) at the end of an expression to get the string value, except after string litterals (like "Hello") where print is smart enough to recognize them as strings.
You can pass one or several parameters to print, and you must separate them with commas if you pass more than one, or you can concatenate all the string parameters with '+'.
Using commas allows you to switch between string and numeric context and back if needed.
You can also pass arrays, and print will print all the values of the array.
Important: On windows platforms, print is going to try to be smart and will replace occurences of "\n" by "\r\n". If you do not wish this behaviour, use Output instead which is the same as print, except that it leaves everything unchanged and this what you want for binary data such as pictures.

Return value:
The total number of characters printed.

Example 1:

print("Hello World!")
Result:
Hello World!

Example 2:

a = 12
print("The value of a is: ", a)
Result:
The value of a is: 12.0000

Example 3:

a = 2
print("a = ", a, "\n")
print("The square of a = ", a * a)
Result:
a = 2.0000
The square of a = 4.0000

Example 4:

a = "Hello" $
print("Numeric value: ", a, "\n")
print("String value: ", a$)
Result:
Numeric value: 0.0000
String value: Hello

Example 5:

t[0] = "Hello" $
t[1] = "Bonjour" $
t[2] = "Guten Tag\n" $
t[3] = "Buongiorno" $
print(t[])
Result:
HelloBonjourGuten Tag
Buongiorno
Note that the '\n' at the end of 'Guten Tag' allows a line break.

Notes:
Some characters cannot be typed directly, because they would cause the line or the string to be broken, instead they are represented by special codes:
\n Line Feed (print to next line)
\r Carriage return, might be needed for DOS files before a '\n'
\t Tab character
\" double quotes
\\ backslash
\0 ASCII 0
\xcc, where cc stands for an hexadecimal value. This one allows you to get any character from 0 to 255. For example 'A' would be coded '\x41'. That's ASCII code 65, written as 41 in hexadecimal.