Advertisement
TheFastFish

not done

Oct 2nd, 2016
410
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. DEF STRUCT N$,A[]
  2. VAR I%,LABEL$
  3. VAR T$,F$
  4. DIM OUT$[0]
  5.  
  6. 'check every slot for struct definitions
  7. FOR I%=0 TO 3
  8. IF CHKLABEL(FORMAT$("%D:@STRUCT_%S",I%,N$)) THEN BREAK
  9. NEXT
  10. 'if said struct doesn't exist, silent fail
  11. 'SB lacks error handling :P
  12. IF I%==4 THEN RETURN
  13.  
  14. 'store the label name
  15. LABEL$=FORMAT$("%D:@STRUCT_%S",I%,N$)
  16.  
  17. RESTORE LABEL$
  18.  
  19. REPEAT
  20. READ T$
  21. IF T$=="END" THEN
  22. CONTINUE
  23. ELSEIF T$=="INT" THEN
  24. READ F$
  25. PUSH OUT$,FORMAT$("%S%%00000000",F$)
  26. ELSEIF T$=="DOUBLE" THEN
  27. READ F$
  28. ELSEIF T$=="STRING" THEN
  29. READ F$
  30. ELSE
  31. 'fail silently
  32. RETURN
  33. ENDIF
  34. UNTIL T$=="END"
  35. END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement