Constants
Dr_Acula
Posts: 5,484
Are constants declared in the CON section of the Main program available to other spin programs that are called from Main?
I was expecting they would be, but when I move the constants from the local spin program (eg the vga driver) to the main spin program, I get an "Unresolved symbol" error.
This is on BST. Am I missing something obvious here? Any help would be most appreciated.
I was expecting they would be, but when I move the constants from the local spin program (eg the vga driver) to the main spin program, I get an "Unresolved symbol" error.
This is on BST. Am I missing something obvious here? Any help would be most appreciated.
Comments
ObjName#ConstantName
Where ObjName is the "local name" for the object in the IMPORTING file.
Oh, just noticed the BST reference. Dunno know about that. I was referring to the Prop IDE.
-Phil
@Phipi - It probably doesn't matter whether I reference from the main to a sub object or the other way. All I really want to do is to be able to declare something once. So even it it isn't where I expect it to be (even buried in code) I can put comments in other places saying where it is. I hope that makes sense!
The only thing I had to do was to put a "throw away method" in the "header file" just to keep the propeller tool "happy."
Maybe that helps
For example see the use of the PinDefs file/objects in my program here:
http://forums.parallax.com/showthread.php?t=125583
I might venture to suggest that if you have started to long for features such as "#define something somevalue" then is time to move up to using C instead of spin.
If BradC were to add all the "little" extentions to Spin that people request then it would resemble C more and more.
Having people produce more amd more objects in "BradC Spin" would be something of a disaster for code sharing as we are used to in the Prop world. Having forked the language and fractutured the user base.
I have been using Free Pascal at work recently and noticed tht this as happened to Pascal a long time ago. It has had so many of these little tweaks added that you may as well use C.