Shop OBEX P1 Docs P2 Docs Learn Events
Reading DAT list — Parallax Forums

Reading DAT list

NewzedNewzed Posts: 2,503
edited 2007-01-01 13:21 in Propeller 1
For Mike Green

Mike, I have a real mystery.· I am writing a program to etch a circle on SuperMill.· The DAT list is very long so I divided it into trav1 and trav2.· Trav1 - about 618 moves - runs perfectly.· Here are the first few lines of trav2:
······· WORD··· "O",1093
······· WORD··· "R",80
······· WORD··· "O",1090
······· WORD··· "R",79
······· WORD··· "O",1085
······· WORD··· "R",76
······· WORD··· "P",0
······· WORD··· "O",1079
······· WORD··· "R",7

When I run trav2 the VGA displays:

Correcting - Going out 0 to 1093 Move 1
Going right 0 to 80 Move 2

Pausing····· X = 80···· Y = 1093

Press C to cancel
Press any other key to continue
There is no pause command - "P",0 - in the DAT list.· Where is that coming from?

If I press a key to continue, the VGA displays:
Going out 3 to 1090 Move 3
Going right 1 to 79 Move 4
Going out 1011 to 79 Move 5· 'This move not in DAT list
Going out -1006 to 1085 Move 6
Of course, the program halts when it is told to go in a negative direction.

Do you have any idea what is going on?· I· tried trav2 in its normal spot, then I saved the program under a new name and deleted trav1 so that trav2 was at the beginning of the DAT block.· Same results.· As I said, the 618 lines of trav1 run perfectly so there can be no problem with the program.· Hope you can help - this is driving me mad, mad, mad.

Sid

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Sid Weaver
Don't have VGA?

Newzed@aol.com
·

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2006-12-31 23:50
    Sid,
    I have no idea what's going on given the amount of information provided. There must be something about how you setup trav2 to be interpreted. I would suggest that you display the address of the data as you interpret it, maybe on the top line of your display, then the words being interpreted, just so you can make sure they're what you expect. Maybe you're missing a quote somewhere early in the WORD list and you're not showing that in the copy you're showing here.
    Mike
  • NewzedNewzed Posts: 2,503
    edited 2007-01-01 00:10
    Mike, I have attached a copy of the program containing trav2.· Trav1, which ran perfectly, was deleted.

    Trav2 is called in Line 448, and if you look at the DAT list for trav2 you will see it is correct.· One of my burning questions is where does the pause after Move 2 come from?· It is not in the DAT list, but the program pauses as if it were there.

    If you don't have time, that's OK.

    Sid













    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Sid Weaver
    Don't have VGA?

    Newzed@aol.com
  • Mike GreenMike Green Posts: 23,101
    edited 2007-01-01 00:59
    Sid,
    In this section
      repeat
        dir := word[noparse][[/noparse]board][noparse][[/noparse]pntr]    ' long
        pntr := pntr + 1
        coord := word[noparse][[/noparse]board][noparse][[/noparse]pntr]     'where I want to go
        if dir =="L"
    
    


    you don't increment pntr a second time. I recall that this has been in your code for some time and I pointed it out before. What's happening is that you're interpreting the coordinate as another operation code. If the coordinate happens to be the same as the character code of some operation, you will execute it. The value 80 is the same as a "P". That's where the pause comes from.
    Mike
  • NewzedNewzed Posts: 2,503
    edited 2007-01-01 01:12
    OK - where do I insert the second pntr increment?

    Sid

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Sid Weaver
    Don't have VGA?

    Newzed@aol.com
    ·
  • NewzedNewzed Posts: 2,503
    edited 2007-01-01 13:21
    Mike, I figured out where it went.· The program is working just fine now.· Again, thank you very much.

    Sid

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Sid Weaver
    Don't have VGA?

    Newzed@aol.com
    ·
Sign In or Register to comment.