HP Forums

Full Version: Number of Variables?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Is there a limit on the number of variables you can create in a program using the local or export commands?
I believe something is limited there based on the size of the count object for variables, but this will be something like 2^16 or so. Don't expect you will be hitting that very quickly...

However, you do have a limit of 8 per command block call. Functions/commands can have 16 arguments. When you do a LOCAL call, it will take 8 variable names, and up to 8 arguments for those.

LOCAL a1, a2, a3, a4, a5:=1, a6, a7, a8; //good
LOCAL a1, a2, a3, a4, a5:=1, a6, a7, a8, a9; //no good
(in actuallity these are both like this internally)
LOCAL a1(:=0), a2(:=0), a3(:=0), a4(:=0), a5:=1, a6(:=0), a7(:=0), a8(:=0)...;

So you can see how it is limited to 8 in each "block".
Reference URL's