I am trying to increase readability (and debuggability) of some inherited code, and am currently having trouble using scalars from other pages of a work file.
The goal is to avoid using %vars and !vars because they are local, and vanish after the execution has been finished. There are chunks of code that need to be run independently (after some heavy estimation has been carried out), and my goal is to not lose some values that are used throughout the document.
The following does not work:
Code: Select all
wfcreate(wf = "exports_factor_model_avk", page = numbers) u 1
scalar year_min = 1990
scalar year_max = 2025
scalar quarter_max = 4
pagecreate(page = dat_qrt) q {year_min}:1 {year_max}:{quarter_max}
pageselect dat_qrt
<some stuff goes on>
pagecreate(page = dat_mth) m {numbers\year_min}:1 {numbers\year_max}:{numbers\month_max}
Error: NUMBERS\YEAR_MIN is not a valid string or scalar name
Am I missing some brackets or extra symbols? Somehow `pagecreate` could read the values from the same page, but not from a different one.
In subsequent calculations, I need to re-use the scalars saved in the `numbers` page: there are many loops and other documents, and I need to do calculations on one page whilst invoking the scalars from the `numbers` page without switching. There must be an easy solution where one would not need to select a page with scalars in order to use those values, and I could not find a similar example in the manual.
Many thanks in advance!
Yours sincerely,
Andreï V. Kostyrka