Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DEF STRUCT N$,A[]
- VAR I%,LABEL$
- VAR T$,F$
- DIM OUT$[0]
- 'check every slot for struct definitions
- FOR I%=0 TO 3
- IF CHKLABEL(FORMAT$("%D:@STRUCT_%S",I%,N$)) THEN BREAK
- NEXT
- 'if said struct doesn't exist, silent fail
- 'SB lacks error handling :P
- IF I%==4 THEN RETURN
- 'store the label name
- LABEL$=FORMAT$("%D:@STRUCT_%S",I%,N$)
- RESTORE LABEL$
- REPEAT
- READ T$
- IF T$=="END" THEN
- CONTINUE
- ELSEIF T$=="INT" THEN
- READ F$
- PUSH OUT$,FORMAT$("%S%%00000000",F$)
- ELSEIF T$=="DOUBLE" THEN
- READ F$
- ELSEIF T$=="STRING" THEN
- READ F$
- ELSE
- 'fail silently
- RETURN
- ENDIF
- UNTIL T$=="END"
- END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement