Shop OBEX P1 Docs P2 Docs Learn Events
POLLRUN — Parallax Forums

POLLRUN

I'm running a Bs2p40 with Editor 2.5. I would like to use:
POLLIN 8, 1
POLLIN 9, 1
POLLRUN 3
POLLMODE 3
The only problem I have is, I need to be able to return back to the point in the program I was at when POLLRUN ran the program in slot 3. Can this be done or do I need to forget about polling?
Thanks for your help.
Arnold

Comments

  • There's no return from a POLLRUN, but sometimes you can fake it. There's a Nuts and Volts column that discusses multi-slot programming and illustrates this technique. Essentially you record the return point to be used in a variable shared between slots (POLLRUN #1, POLLRUN #2, etc.) At the beginning of your main slot you check that variable. If it's zero, you continue from the beginning of the slot. If it's non-zero, you GOTO the label following the corresponding POLLRUN. At the end of your slot 3 code, you RUN your main slot. The shared variable will be initialized to zero on a reset.
    ON returnPoint GOTO start,pollrun1,pollrun2,...
    start:
    ...
    returnPoint = 1
    POLLRUN ...
    pollrun1:
    ...
    
  • I think Mike is referring to Column 80, in volume 3 or 2/69. Check 'm both.
  • It's the column on multi-bank programming here.
Sign In or Register to comment.