Maximum Characters used in a variable Name?
DavidM
Posts: 630
HI,
What is the MAXIMUM number of characters that can be used in a variable Name?
I am having a strange problem, I am using two variables which look similar but SHOULD Be considered as Different Variables, Unless there is a character limit
These are my two variables.
SequenceTimePtr
SequenceTimerPtr
I had a look through the manual and its not mentioned!
I believe you can use very long variable names, but the compiler will only use UP TO a certain amount for TAGGING Purposes,
Can someone please show me were the specification for this is?
Thanks
Dave M
What is the MAXIMUM number of characters that can be used in a variable Name?
I am having a strange problem, I am using two variables which look similar but SHOULD Be considered as Different Variables, Unless there is a character limit
These are my two variables.
SequenceTimePtr
SequenceTimerPtr
I had a look through the manual and its not mentioned!
I believe you can use very long variable names, but the compiler will only use UP TO a certain amount for TAGGING Purposes,
Can someone please show me were the specification for this is?
Thanks
Dave M
Comments
I just did a test,
I changed the first character of one of my variables to a "Z" instead of an "S",
and now the code runs as it should,
So I conclude that Variable names are not used FULLY during COMPILING,
( But I could be wrong)
regards
Dave
Simple test:
After re-reading it it may not be related to your issue at all but it sounded familiar (duplication/removal). Do you have more details or a minimal test case? Also, is the generated byte code (*.binary) the same for both (S/Z)? That may be a starting point.
My guess it 8 Characters!
Anybody else dare to differ!
Thanks
Dave M
word rootDirectorySectors, rootDirectorySectorNumber
So at least BST is happy.
Thanks for the language reference, hard to find, still doesn't explain the problem!
Possible SPIN COMPILER BUG??
Dave M
Bill
Odd, why is the proptool then complaining about 30+?
Edit: rev 1.1 actually mentions 30
As much as i would love to, I cannot post my code, as it is company confidential ( especially where this problem occurred)
But heres what I know/did
This OBJECT that I "HAD" the problem in, has been reliable and workings for MONTHS! no changes.
I needed to change just ONE VARIABLE NAME from "MasterTimer" to "SequenceTimer" as I was modifying my master timer code ( another object) to be more useful, and I like to have descriptive variable names.
So I did a FIND & REPLACE ( in all of this object) , knowing that I had a few variations of this variable name within this object.
i.e
SequenceTimerPtr ( A LONG declared in the VAR BLOCK , which hold the Address of the variable for later use)
vSequenceTimerPtr ( A reference to an address used to point to the values used in the calling object ( declared in my INIT Method of this object) , this is my standard naming convention)
So I did the find and replace, and checked each variable name change carefully and then compiled and ran my code, only to discover that my timer was not running, in fact the system froze!
When I replace the "S" in sequence with a Z, in all the same places, I got the code to function just as it did before.
I am not using any "@" address references.
thanks
Dave M
I've used nothing but very long variable names, very often pushing 30 characters, for the past 2+ years and I've never seen this problem before. But now you have me worried about it. Please keep us posted on this possible bug.
thanks,
Thanks for the heads up. I also like to use discriptive variable names. I can't find mention of which version of the Propeller Tool you're using. Maybe it's a bug that has been fixed in a more recent version. (Or one introduced in a later version.) Which version did you use?
Thanks,
Duane
-Phil