![]() |
How about a slot directive?
It might be nice to have a slot directive that allows you to start the code for a different programming slot in the same file.
Typical directives: To start a new slot (slot number assigned by the preprossor -- we refernence them by name): {$SlotStart slotname} To end a slot (perhaps not required, either the file ends or a new slot begins: {$SlotEnd} To run another slot (preprocessor resolves the slotname to the required number) {Run slotname} Along with this I would say it would be nice to have "global" include directives and "local" include directives. This would let us have some code (say the declarations of variables, constants, etc.) included in all programming slots and then but then we could include special code in specific programming slots. I know I am asking a lot, but you asked for feedback. Joe J. |
Label Example
Quote:
Code:
AppleTest: {$if X = Apple} |
Re: How about a slot directive?
Quote:
Quote:
Quote:
|
How about another preprocessor directive?
I'm thinking about adding another directive similar to the $Slot directive suggested by Dr. Joe.
$Slot demarks a section of a preprocessor source file to be output as a separate BASIC Stamp program which is loaded into one of the suplemental program slots. The new directive would identify a portion of a file which can be $Included in any of your $Slot output files. I'm proposing $IncludeSource for the directive name. The syntax would be {$IncludeSource symbolic_name}. The source file lines between the $IncludeSource and a subsequent $EndIncludeSource directive can then be $Included using symbolic_name. Example: Code:
{$Stamp bs2sx} |
From my understanding of the original posted question, you want to avoid typing multiple "IF" statements.
http://parallaxinc.com/downloads/Doc...ual%20v2.0.pdf That's a link to the manual for the Basic Stamp, look up the "Branch" code. (Pages 85 & 86) ~Excerpt from Basic Stamp Manual~ [b]Explanation:[\B] The BRANCH instruction is useful when you want to write something like this: IF value = 0 THEN case_0 ' value =0: go to label "case_0" IF value = 1 THEN case_1 ' value =1: go to label "case_1" IF value = 2 THEN case_2 ' value =2: go to label "case_2" You can use BRANCH to organize this into a single statement: BRANCH value, [case_0, case_1, case_2] |
| All times are GMT -5. The time now is 11:08. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi