Skip to content

Instantly share code, notes, and snippets.

@ThomasTheSpaceFox
Created October 19, 2018 00:50
Show Gist options
  • Save ThomasTheSpaceFox/d095563edb8340d2793e361842905e69 to your computer and use it in GitHub Desktop.
Save ThomasTheSpaceFox/d095563edb8340d2793e361842905e69 to your computer and use it in GitHub Desktop.
A basic example of SSTNPL's table system.
#### variable setup ####
var chbuff=0
##### printing VS non-printing #####
prline I print
gsub self_printing_sam
prline I don't print.
gsub non_printing_sam
##### reading & writing tables #####
tabr sam,@0,@0
set chbuff
chardump chbuff
newline
tabw sam,@0,@0,:a
tabcd sam,@0,@0
newline
##### working with double-cell tables #####
tabcd bob,@0,@0
newline
tabdd2 bob,@0,@0
newline
tabw bob,@0,@0,:a
tabw2 bob,@0,@0,@10
tabcd bob,@0,@0
newline
tabdd2 bob,@0,@0
#### exit code ####
newline
prline press a key to exit
keyprompt
stop
####### table data below #######
#### prline-based ####
label self_printing_sam
table sam,4,3
prline ABC
prline 123
prline XYZ
return
#### tstr-based ####
label non_printing_sam
table sam2,3,3
tstr ABC
tstr 123
tdat ;:X;:Y;:Z
return
##NEVER TRY TO RUN A DOUBLE-PACKED TABLE
#### Double-cell table ####
table bob,3,2
tdat @1 :A;@2 :B;@3 :C
tdat @4 :D;@5 :E;@6 :F
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment