I have defined an array variable with various surface parameters called L1(i,j)
for example:
L1(1,1) is the value of a curvature
L1(1,2) is the value of a thickness
I would like to use the numeric values of this array variable in a .ZPL so for instance I could say:
SETSURFACEPROPERTY 12, 2, L1(1,1)
but I see that I cannot use a variable that is a number for the value of the curvature., has to be converted to a STRING Why the heck not, the curvature is not a string but IS a number? Just another backward ancient programming ZEMAX thing.
Anyway, I guess that the value of the lens parameter to set has to be a STRING, a number, or a numerical expression, not a variable? So how do I convert L1(1,1) to a STRING to set the curvature parameter in the lens which is actually not a string but a number? Retarded.
I thank anyone for the time taken to help. I tried to use the $STR(val) and FORMAT but loe and behold can’t get that to work.
Like $STR(L1(1,1)) gets rewarded an error message.
…………………………………………………………………………………………………..
As an aside, it’s like you can’t hardly do any lens-parameter-based math on the fly in a .ZPL.
If I want to set a variable to be the ratio of (thickness 2)/(thickness 1), I have to define operands in a Merit Function that calculate to thickness 1 and thickness 2 and then do the ratio there and then call in the .ZPL the proper Merit Function row and column that has that ratio.
I have to know the row,column. So when I or anybody else comes back and looks at that macro, they have to figure out what is in Merit Function Row 2 Column 7. Unless you add comments to every maco line.
in CodeV in the macro I write:
^ratio == (thi s2)/(thi s1)
what’s worng with that? It;s like an English sentence.