PDA

View Full Version : Is anyone using the BASIC Stamp Preprocessor?


Greg Ross
02-07-2002, 02:02 AM
I just uploaded a new version (v2.11) to the white papers section. This version includes the $Slot and $Run directives as suggested by Dr. Joe.

If you are using it, can you please share how you use it?

Personally, when I am programming our robot, I use the preprocessor as a launching pad. From the preprocessor GUI, I launch the BASIC Stamp Editor to edit the program file.

After I have made my edits, I save them, and switch back to the preprocessor GUI, and preprocess the file.

After the preprocessing is complete, I again launch the editor -- this time on the intermediate (output from the preorocessor) file(s). So now I have 3 windows open: the preprocessor and 2 editor instances.

While debugging, I put debug statements in the intermediate files, so I don't have to strip them out after I'm done debugging -- all I have to do is preprocess the source file again. (I do have to remember though, that if I make any functional changes to any of the intermediate files, I need to make them in the source file too.)

GreenDice
02-08-2002, 02:47 PM
Greg,

I tried your preprocessor. It works great. I am just too swamped to rewrite our control program at this point. I think I am going to
do it after the robot is shipped. It will become a easier program to maintain and understand.

One request:
I would like it better if you keep the same file name as the input file but name the output file with .bsx extension (or other extensions based on the Pbasic directive).
For example, all Pbasic preprocessor input files must have .bsp extension. A 020702.bsp file will give me 020202.bsx as output.

Greg Ross
02-10-2002, 07:32 PM
Originally posted by GreenDice
I would like it better if you keep the same file name as the input file but name the output file with .bsx extension (or other extensions based on the Pbasic directive).
For example, all Pbasic preprocessor input files must have .bsp extension. A 020702.bsp file will give me 020202.bsx as output.

I think that's a good idea. BSP is the file extension used for BASIC Stamp 2P source files though. How about SPP? BPP? BSPP? I think I prefer the latter. As far as I know, the convention of using 3 or fewer file extension characters is a holdover from DOS days, and BSPP should work fine.

GreenDice
02-11-2002, 08:10 AM
Greg,

I personally like BSPP because it will stand out better.

Greg Ross
02-12-2002, 12:24 PM
V2.13 of the BASIC Stamp Preprocessor adds the capability of C style continued source file lines.

Normally, a PBASIC command is required to be on a single line. You are now able to continue lines (as in C) by ending the line with a backslash character. (If you should need to end a line with a backslash but need the next line to not be appended, you may "escape the escape character" by doubling the backslash.)

Example:
(The following code snippet may look vaguely familiar -- yet somehow different. )


' Serin COMA\COMB, INBAUD,
' [ oi_swA, oi_swB, rc_swA, rc_swB,
' p2_x, p1_x, p4_x, p3_x,
' PB_mode, packet_num, sensor1, sensor2,
' p2_y, p1_y, sensor3, sensor4,
' p4_y, p3_y, sensor5, sensor6,
' p2_wheel, p1_wheel, sensor7, bat_volt,
' p4_wheel, p3_wheel, p2_aux, p1_aux,
' p4_aux, p3_aux, delta_t, res01 ]
'
Serin COMA\COMB, INBAUD, \
[ oi_swA, oi_swB, rc_swA, rc_swB, \
p2_x, p4_x, \
sensor1, sensor2, \
p2_y, sensor3, \
p4_y, sensor5, sensor6, \
p2_wheel, \
delta_t ]