Data AcQuisition And Real-Time AnalysisScope - Spectrum - Spectrogram - Signal Generator
Software for Windows
Science with your Sound Card!
Contact us about
Macro Line Continuation
Macro commands can use expressions that extend beyond the editor window. Although you can scroll the window horizontally to see the right-most portions, this can be awkward. For math expressions, it's often possible to break a long chain of operations into stages. But there is no analogous way to deal with long string expressions.
Instead, you can break any expression into multiple lines by using an underscore (_) to denote that the expression continues on the next line. For example:
L.0.ToneFreq=L.1.ToneFreq + L.0.ToneFreq/2
can be written as:
L.0.ToneFreq=L.1.ToneFreq + _ L.0.ToneFreq/2
L.0.ToneFreq=L.1.ToneFreq _ + L.0.ToneFreq/2
Very long expressions can be broken into as many lines as needed. Note that the underscore must only appear between terms or operators, not in the middle of variable or function names. Prefixes are regarded as part of the variable name, so you can't break anywhere in L.1.ToneFreq, for example.
You can only break on the right side of an expression.
For string expressions, an underscore within quotes will be treated as part of that string, not a line continuation. But you can break a long quoted string into shorter quoted strings and separate them with an underscore at the end of one line, and a '+' at the start of the continued line. For example:
Msg="First degree hyperventilation coefficient: " + X
can be written as:
;CORRECT: Msg="First degree hyper" _ + "ventilation coefficient: " + X
However, unlike numerical expressions, string expressions can't have the '+' just before the '_', unless there is a redundant '+' at the start of the continued line:
;WRONG: Msg="First degree hyper" +_ "ventilation coefficient: " + X ;ACCEPTABLE: Msg="First degree hyper" +_ + "ventilation coefficient: " + X
Note that if a line ends with an underscore, the following line must be a valid continuation. You may not comment out continuation lines, unless you also comment out the initial underscore line.
Questions? Comments? Contact us!We respond to ALL inquiries, typically within 24 hrs.
Over 35 Years of Innovative Instrumentation
© Copyright 2007 - 2021 by Interstellar Research
All rights reserved