"include" equivalent in propeller tool ?
bdickens
Posts: 110
I'm working on an application that has a lot of common code blocks. Ultimately, we will have 5 separate props running variations of the same program. But I'm getting exhausted making changes in all 5 every time I "fix" a chunk of code that is in all 5.
And sooner or later, I will screw up.
is there an equivalent to the //include command that will pull source code in ?
The "OBJ" blocks come in and can't reference my variables directly and I'm even worse at the @, @@ stuff. Yes, I'm lazy but I've accidentally changed the code a couple of times, lost the change in the next copy / paste.
Thanks
And sooner or later, I will screw up.
is there an equivalent to the //include command that will pull source code in ?
The "OBJ" blocks come in and can't reference my variables directly and I'm even worse at the @, @@ stuff. Yes, I'm lazy but I've accidentally changed the code a couple of times, lost the change in the next copy / paste.
Thanks
Comments
It is possible to use "objects" to do something like what you want. You can have an object with little or no local storage, but with constants and methods, all of which can be referenced outside of the object and then refer to this object from several other objects in your program. The compiler will detect that all these object instances use the same code and use only one copy of the binary code. Some of the FemtoBasic versions use this technique for program-wide global constants (look at DongleBasic or BoeBotBasic in the Object Exchange).
Another option, depending on what you're trying to do, would be to use BST's conditional compilation
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Leon Heller
Amateur radio callsign: G1HSM
It's still a PITA but it's a workaround.
Forum: http://forums.parallax.com/showthread.php?p=655470
Download newest version at:www.insonix.ch/propeller/prespin.html
Andy
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:
· Home of the MultiBladeProps: TriBlade,·RamBlade,·SixBlade, website
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
· Prop Tools under Development or Completed (Index)
· Emulators: CPUs Z80 etc; Micros Altair etc;· Terminals·VT100 etc; (Index) ZiCog (Z80) , MoCog (6809)·
· Prop OS: SphinxOS·, PropDos , PropCmd··· Search the Propeller forums·(uses advanced Google search)
My cruising website is: ·www.bluemagic.biz·· MultiBlade Props: www.cluso.bluemagic.biz