Why are version 1,2 and 3 working, but version 4 fails with: Null regex not allowed
when using //
over multiple lines?
#1
say Nil //
try {'a'++} //
1;
#2
say Nil
// try {'a'++} //
2;
#3
say Nil
// 3;
#Fails with: Null regex not allowed
say Nil
// try {'a'++}
// 4;
a : consisting of multiple lines of text a multiline headline : capable of showing, containing, or processing multiple lines of text a multiline display/field New multiline optical character readers are already being put in place; they can read an entire address and spray forth a bar code that stands for a nine-digit ...
Definition of 'multiline' 1. 2. Imagine the Oval Office, a room full of polished wood and mementos, multiline telephones and important papers.
We can write multiline macros like functions, but for macros, each line must be terminated with backslash '\' character. If we use curly braces '{}' and the macros is ended with '}', then it may generate some error. So we can enclose the entire thing into parenthesis.
A multline text input field stores a string as its value and a string as its text. Its value is always a valid string, while its text could be any string entered into its editor. Unlike a text input field, this field also supports newline characters entered in the editor.
There is try
block at the end of a line.
It is same as
say Nil
// try {'a'++};
// 4;
See documentation:
It is OK to skip the semicolon between the last statement in a block and the closing }
.
You can try
say Nil
// try {'a'++}\
// 4;
or
say Nil
// (try {'a'++})
// 4;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With