HistoryCal - V0.0.7 Manual
write Statement

Home Development V0.0.7 Manual Script write Statement

write And writeln Statements

The write and writeln statements are intended to provide output. The only difference between the two statements is: writeln will automatically add a new line at the end of the output, whereas write will not.

The expression following is first evaluated and then "stringified", or converted into text, and sent to the output devise.

write Statement
FormatExampleOutput
write str_expr; write "Today is: " + string,g:dmy today; Today is: 14 Oct 2016
write field_expr; write today + 50; 2457726
write rlist_expr; write today ~ today + 50 \ today + 25; 2457676 ~ 2457700 | 2457702 ~ 2457726
write record_expr; write record,g today; {"g", 2016, 10, 14, ?}
Written when today equalled "jdn# 2457676" or "g:dmy# 14 Oct 2016"

It should be noted the the plus operator '+' is used for both numerical addition and string concatenation. The rule is, if both sides of the operator are numbers, the values are added together. But if one side is a string, the other side is converted to a string and the two concatenated. Since operators of equal precedence are evaluated from left to right, one string to the left of a succession of numbers being added will affect them all.

ExampleResult
write 5 + 10 + 15;30
write "" + 5 + 10 + 15;51015
write "" + 5 + (10 + 15);525

Output

For the HistoryCal program, output is shown in a message box when the script completes.


Valid XHTML 1.0 Strict

12th October 2016