Stamp Editor feature
bobhillier
Posts: 27
Perhaps this has been asked before....
Can a future upgrade to the Stamp Editor provide an include-file capability?
I'm doing multi-page programming and am constantly copying the "header" section of page 0 to all the other pages to ensure every page has the correct scratchpad, variable and constants layout. Programs behave very badly when one page does not have the same scratchpad, variable and constants structure as the rest of the pages.
Clever use of conditional compile could also result in strong and efficient support of multi-page page-flip code as well as other significant code re-use opportunities.
There are a multitude of ways that include files could improve and empower Stamp development.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
······ Bob, Ottawa
W75 54 17·· N45 18 30
·········· G16 #27
Can a future upgrade to the Stamp Editor provide an include-file capability?
I'm doing multi-page programming and am constantly copying the "header" section of page 0 to all the other pages to ensure every page has the correct scratchpad, variable and constants layout. Programs behave very badly when one page does not have the same scratchpad, variable and constants structure as the rest of the pages.
Clever use of conditional compile could also result in strong and efficient support of multi-page page-flip code as well as other significant code re-use opportunities.
There are a multitude of ways that include files could improve and empower Stamp development.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
······ Bob, Ottawa
W75 54 17·· N45 18 30
·········· G16 #27
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Sid Weaver
4-digit serial LED
http://hometown.aol.com/newzed/index.html
·
All the high level languages I've worked with support include files. It would be nice if Stamp did as well.
"Somewhere.... over the rainbow...."
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
······ Bob, Ottawa
W75 54 17·· N45 18 30
·········· G16 #27
It doesn't affect the token code created so the impact of adding such a feature is isolated. I also think the concept of includes is simple enough to not scare newbies away.
Hope it at least makes it onto a Parallax todo list!
Harry
It's not that easy because the compiler is external and wants to flag a file if there's an error.· If you have an include file that just contains variable definitions, it won't compile.· So, what the BASIC Stamp editor would have to do is copy your include file into your source then save it to a new file to pass on to the compilation module.· But how do we flag an error then?· If you have an error in your definitions, how do we tell you?· Or in your code? -- because to get everything to compiler is has been merged into one file that is not your original source.
We're not giving up ... I just wanted to point out that our compiler engineer has thought long and hard about this and adding include files is NOT as trivial as we would all like to believe.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas Office
Jon is correct.· I've thought long and hard about this issue and the complexities it entails as Jon noted.· I, too, am not giving up on it, but we had to make a decision during the last major overhaul of the tokenizer and editor about some very important items and the #INCLUDE feature had to be temporarily set aside.
But, again, we have not given up on the request.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
--Jeff Martin
· Sr. Software Engineer
· Parallax, Inc.
In windows, I suppose it wouldn't be hard to write code that appends a given header where ever it finds a given a special comment of sorts in files, but this no more effecient than copy and paste because you'd have to leave the program to do it. I suppose a useful tool that anyone who knows a little C could put together is a program that checks a "header" file and checks code between two special comments ("'START HEADER" and "'END HEADER" for instance) if they don't match the header, replace the code in the section with the code in the header.
something along the lines of (note this was written in haste and doesn't do some needed checks on streams and boundries and assumes some varibles you'd have to get from input or argc & argv):
David Drake
Hadronex