Sorceress

Stacks in QBasic

Dec 24th, 2016
222
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. DIM stack(255) as LONG
  2. DIM stackptr as LONG
  3.  
  4. Function Push(x)
  5. stackptr = stackptr + 1
  6. stack(stackptr) = x
  7. End Function
  8.  
  9. Function Pop(x)
  10. x = stack(stackptr)
  11. stackptr = stackptr - 1
  12. End Function
RAW Paste Data