Shop OBEX P1 Docs P2 Docs Learn Events
Coding debug error [] — Parallax Forums

Coding debug error []

PwnSaladPwnSalad Posts: 8
edited 2012-05-09 09:57 in BASIC Stamp
Here is the code:' {$STAMP BS2}
' {$PBASIC 2.5}

letter VAR Word
land VAR Byte
letter1 VAR Word

A VAR Byte
B VAR Byte
E VAR Byte
F VAR Byte


land = 0
letter1 = 0
numbers VAR Word
letters VAR Word
Choice VAR Word



DEBUG "Press 1 to go up, and 2 to go down."

Control:
DO
DEBUGIN NUM letter
IF letter = 1 THEN letter1 = letter1 + 5
IF letter = 2 THEN letter1 = letter1 + 10
IF letter = 3 THEN letter1 = letter1 - 5
IF letter = 4 THEN letter1 = letter1 - 10
IF letter > 127 THEN letter1 = 127
IF letter1 > 127 THEN letter1 = 127
IF letter = 9 THEN land = 1
IF land = 1 THEN GOSUB intervalcheck

DEBUG CLS
DEBUG SDEC ? letter
DEBUG SDEC ? letter1

LOOP WHILE land = 0
IF land = 1 THEN GOSUB intervalcheck



intervalcheck:
DEBUG "Initiating landing sequence"
PAUSE 1500
DEBUG CLS
DEBUG letter1
IF letter1 =< 0 THEN GOSUB timeforbed
IF letter1 > 20 THEN GOSUB largesteps
IF letter1 =< 20 THEN GOSUB babysteps



largesteps:
DO
IF letter1 => 127 THEN letter1 = letter1 - 10
IF letter1 =<20 THEN GOSUB babysteps
LOOP

babysteps:
DO
IF letter1 =<20 THEN letter1 = letter1 - 5
IF letter1 =<0 THEN GOSUB timeforbed
LOOP

timeforbed:

END


When you run the code it should check to see how big the steps should go down by, but when it debugs letter1, the main variable, it debugs as [].

Run the code
type in 200 to set it to 127
then hit 9

Help please.

Comments

  • PwnSaladPwnSalad Posts: 8
    edited 2012-05-09 06:40
    Bump.
    need help D:
  • Mike GreenMike Green Posts: 23,101
    edited 2012-05-09 07:22
    1) Do not do "bump". It's impolite and it's not allowed.

    2) Maybe you're asking about the DEBUG statement in intervalcheck? Do you want something like DEC or SDEC in front of the "letter1"?
  • PwnSaladPwnSalad Posts: 8
    edited 2012-05-09 08:11
    Mike Green wrote: »
    1) Do not do "bump". It's impolite and it's not allowed.
    2) Maybe you're asking about the DEBUG statement in intervalcheck? Do you want something like DEC or SDEC in front of the "letter1"?

    I did a debug ? dec letter1 and it worked :D

    Also no where in the rules does it say anywhere against bumping, It's not impolite its just saying : "Hey Im still here and no one has answered my question."
    It's about about as impolite as raising your hand in class.
  • Mike GreenMike Green Posts: 23,101
    edited 2012-05-09 09:09
    Be reassured. Bumping is not allowed because it's an example of essentially an empty message ... it doesn't add to the thread. If someone doesn't respond to your message within what you feel is a reasonable amount of time, perhaps it's because the question posed is confusing or poorly stated or lacks sufficient information to answer or will take too much effort to figure out and doesn't appeal to anyone to answer. This is a mostly volunteer forum. When someone takes the time and effort to pose a clear and well-described question and provides examples of the issue, when they include a description of the problem they're trying to solve and include their program source with comments and proper formatting, they typically get a quick reply. When these things are absent, it usually takes longer. Maybe they're asked to provide the missing information first. In any event, bumping is treated as a sign of impatience at best and does not endear you to those people that you would like to help you.
  • davejamesdavejames Posts: 4,047
    edited 2012-05-09 09:57
    PwnSalad wrote: »
    Also no where in the rules does it say anywhere against bumping.


    Just closing the loop: http://forums.parallax.com/showthread.php?134682-Forum-Guidelines
Sign In or Register to comment.