Post Reply 
Number of Variables?
06-05-2015, 03:56 PM
Post: #1
Number of Variables?
Is there a limit on the number of variables you can create in a program using the local or export commands?
Find all posts by this user
Quote this message in a reply
06-05-2015, 04:10 PM (This post was last modified: 06-05-2015 04:11 PM by Tim Wessman.)
Post: #2
RE: Number of Variables?
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".

TW

Although I work for the HP calculator group, the views and opinions I post here are my own.
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)