MAD-X
MAD-X copied to clipboard
Variables with the same name as functions
I observed that if you try to define a variable the same name as an ordinary function MADX just ignores the line and does not give an error message. E.g. "FRAC = 1;" will be read in by MADX without error or warning messages, but if you then try to do "A = 1/FRAC;" there is an error message and A is just set to 0. There should probably be a warning if a variable cannot be defined.
Bonus observation: it is possible to define a variable called "MATCH" but only by telling MADX that it is an integer before e.g. "int match = 2; value, 4/match;" returns 2. This method does not work with ordinary functions.