home *** CD-ROM | disk | FTP | other *** search
RISC OS BBC BASIC V Source | 1993-06-08 | 23.1 KB | 832 lines |
- >ConvTmplt
- Usage$ = "ConvTmplt <in> <out> [-Hourglass] [-Title] [-TFont <name>] [-TSize <points>] [-Icon] [-IFont <name>] [-ISize <points>] [-CheckColours] [-BValidation] [-Extent] [-IndSize <n>] [-Sort] [-Debug]"
- v5.00 - CJB 08.06.1993 added -Sort ordering
- v4.00 - CJB 27.01.1993 add scroll bars if old style-window & extent
- v3.01 - CJB 18.01.1993 Interface v2.00 has validation strings b5, b6, and b7
- convert validation strings z0-z7
- v3.00 - CJB 30.12.1992 -IndSize + wimp > 2.87 template handling uses less memory
- much better error messages
- extent => force bounded + title bar/quit icon
- only opens a font once
- v2.10 - CJB 22.11.1992 changed so length of indirected buffer is 32K now
- This program filters Wimp Template files (including those with fonts)
- [requires CAssembler module to be resident]
- It optionally converts text icons to an anti-aliased font, handling
- colour correctly
- would like to resize icon bbox if new anti-aliased text ends up being clipped
- MACHINE: Archimedes, RiscOS3.10 (wimp >= 2.87 better memory)
- LANGUAGE: BBC BASIC V (v1.05)
- AUTHOR: Cy Booker,
- 86 Church View, Main Road, Crockenhill, Swanley, Kent.
- BR8 8JW
- Debug% =
- initmemory
- sizeof_q% = 512
- malloc(q%, sizeof_q%)
- _define_constants
- calloc(Fonts%, 256)
- malloc(messages%, 4)
- window%(300) :
- a reasonable upper bound
- malloc(windowid%, 4*
- (window%(), 1)):
- pointer to nul-terminated window id$
- FontName$(2), FontSize%(2), FontHandle%(2) : NFonts% = 0
- n_windows% = 0
- _Lose_Fonts:
- (M
- we may not have to actually start a wimp task to Wimp_OpenTemplate,
- ))
- but it does no harm to, anyway!
- $q%="TASK"
- messages%!0 = 0
- ,`
- "Wimp_Initialise", 300, !q%, "Convert Templates", messages%
- WimpVersion%, taskhand%
- .7
- "XWimp_CloseDown",taskhand%,!q%:
- /'
- _Load_Templates(input_file$)
-
- 1&
- "Wimp_Poll",0,q%+4
-
- A%=0
- 3(
- _Save_Templates(output_file$)
- 4-
- "Wimp_CloseDown",taskhand%,!q%
- _Lose_Fonts
- _Lose_Fonts
- i%= 0
- Fonts%?i%
- <!
- "XFont_LoseFont", i%
- Fonts%?i% -= 1
- >
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- D' creates each window in turn
- sets
- n_windows%
- G) window%(0..n_windows%-1)
- HF windowid%[0..n_windows%-1] = ptr to nul-terminate id$
- I% templates_file_size%
- _Load_Templates(file$)
- idrove%, id%, length%, r0%, c%, t%
- template%, t_name%
- "OS_File", 17, file$
- r0%,,,, length%
- r0%<>1
- 1, "Can't open `"+ file$+ "'"
- Q$ templates_file_size% = length%
- malloc(template%, length%)
- WimpVersion% < 287
- malloc(id%, IndSize%)
- malloc(t_name%, 16)
- "Wimp_OpenTemplate",, file$
- "XWimp_CloseTemplate":
- next% = 0
- n_windows% = 0
- idrove% = id%
- [
- t_name%!0 =
- ("*")
- $t_name% = "*"
- ^!
- WimpVersion% >= 287
- _Y
- "Wimp_LoadTemplate", 0, 0, 0, 0, 0, t_name%, next%
- ,, IndSize%,,,, next%
-
- next%
- t_name%?12 = 13
-
- cI
- $+ " [loading window `"+ $t_name%+ "']"+
- d>
- IndSize% < 0
- 1, "Negative indirect size"
- eS IndSize% += 1 :
- +1 handles size == zero
- f&
- malloc(id%, IndSize%)
- gY
- "Wimp_LoadTemplate",, template%, id%, id%+IndSize%, Fonts%, t_name%, 0
-
-
-
- kt
- "Wimp_LoadTemplate",, template%, idrove%, id%+IndSize%, Fonts%, t_name%, next%
- ,, idrove%,,,, next%
-
-
- next%
- t_name%?12 = 13
-
- pH
- $+ " [creating window `"+ $t_name%+ "']"+
- q>
- malloc(windowid%!(n_windows%*4),
- ($t_name%)+1)
- r7
- putz(windowid%!(n_windows%*4), $t_name%)
- sF
- "Wimp_CreateWindow",, template%
- window%(n_windows%)
- n_windows% += 1
-
-
- next%=0
- "Wimp_CloseTemplate"
- free(template%)
- free(t_name%)
- n_windows%=0
- 1, "No windows in template file"
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- / Needs external templates_file_size%
- O This is so can allocate a big enough buffer to guarantee no need to
- % check for buffer overflow
- T builds entire template in memory and then blits the lot to a file at end
- U this has the side-effect of maybe increasing the file size by a couple of
- Z bytes per template, because need each template to start on a word-aligned word
- W If an error occurs you lose some memory, but who cares - it gets given back
- when the app dies.
- _Save_Templates(file$)
- FontH%, sizeof_hdr%, sizeof_whdr%, sizeof_font%
- newfonts%, buffer%, ind%, temp%, win%, rove%, i%, j%
- n_icons%, icons%, icon%
- window$, icon$
- array%, a%, P%, L%, O%, code%, lr, sp, pass%
- Hourglass%
- "XHourglass_On"
- _Hourglass_Off:
- FontH% = 1
- sizeof_hdr% = 16
- sizeof_whdr% = 24
- sizeof_font% = 48
- calloc(newfonts%, 256)
- A
- malloc(buffer%, templates_file_size%*2 + 2*sizeof_font%)
- F
- malloc(ind%, 256) :
- scratch space for indirected text
- J
- malloc(temp%, 16) :
- scratch space for non-indirected text
- $ win% = buffer% + sizeof_hdr%
- 6 rove% = win% + (n_windows% * sizeof_whdr%) + 4
- %
- malloc(array%, n_windows%*4)
- i%= 0
- n_windows%-1
- + array%!(i%*4) = n_windows%-1 - i%
- Sort%
- L% = 18*4
- &
- malloc(code%, L%):L%+=code%
- lr = 14
- sp = 13
- $
- pass%= %1100
- %1110
- P% = 0:O% = code%
- [OPT pass%
- STMFD (sp)!, {lr}
- G LDR R2, [R12, R0, LSL #2] ; pointer to string
- G LDR R3, [R12, R1, LSL #2] ; pointer to string
- MVN R0, #0
- . SWI "Territory_LowerCaseTable"
- .loop
- LDRB R1, [R2], #1
- LDRB lr, [R3], #1
- LDRB R1, [R0, R1]
- LDRB lr, [R0, lr]
- TEQ R1, #0
- ! Beq end_of_string
- CMP R1, lr
- Beq loop
- LDMFD (sp)!, {pc}
- .end_of_string
- CMP lr, #0
- LDMFD (sp)!, {pc}
- ]
-
- pass%
- @
- "OS_HeapSort", n_windows%, array%, code%, windowid%
-
- &
- process each window in turn
- a%= 0
- n_windows%-1
- i% = array%!(a%*4)
- + window$ =
- getz(windowid%!(i%*4))
-
- <
- $+ " [window `"+ window$+ "']"+
- U
- Hourglass%
- "XHourglass_Percentage", (n_windows%-i%)*100/n_windows%
- :
- may extend file length a bit, but who cares!
- % rove% = (rove% + 3)
-
- department of...
- $
- rove%!-4, window%(i%)
- -
- "Wimp_GetWindowInfo",, rove%-4
- $
- rove%!-4, window%(i%)
-
- ... dirty tricks
- D win%!0 = rove% - buffer% :
- file offset
- O win%!4 = rove% :
- so can calc total size
- K rove%!24 = &C0B00639 :
- window open behind
- G rove%!64 = 1 :
- System sprites
- xmin% = rove%!40
- ymin% = rove%!44
- xmax% = rove%!48
- ymax% = rove%!52
- n_icons% = rove%!84
- icons% = rove% + 88
- , rove% = icons% + (32 * n_icons%)
-
- 0
- $+ " [titlebar]"+
- w
- _Relocate_Icon_Data(win%!4, rove%, win%!4 + 56, win%!4 + 72, AlterTitle%, TitleFont$, TitleFontSize%,
-
- icon% = 0
-
- icon% < n_icons%
- icon$ =
- (icon%)
-
- :
- $+ " [icon "+ icon$+ "]"+
- ~
- _Relocate_Icon_Data(win%!4, rove%, icons%+16, icons%+20, AlterIcon%, IconFont$, IconFontSize%, CheckColours%)
- 1
- xmin%>icons%!0
- xmin%=icons%!0
- 1
- ymin%>icons%!4
- ymin%=icons%!4
- 1
- xmax%<icons%!8
- xmax%=icons%!8
- 3
- ymax%<icons%!12
- ymax%=icons%!12
- icons% += 32
- icon% += 1
-
-
-
- Extent%
- icons% = win%!4
- flags% = icons%!28
- L flags% = flags%
- (1 << 6) :
- window is bounded
- N flags% = flags%
- (1 << 26) :
- title bar exists
- O flags% = flags%
- (1 << 25) :
- close window icon
-
- flags% >= 0
- N flags% = flags%
- &0000008D :
- old-style window
-
- M
- ((xmax%+0.0 - xmin%) > 900.0)
- (ymax%+0.0 - ymin%) > 900.0
- I flags% = flags%
- &70000000 :
- scroll bars
-
- icons%!28 = flags%
- icons%!40 = xmin%
- icons%!44 = ymin%
- icons%!48 = xmax%
- icons%!52 = ymax%
- icons%!0 = 0
- icons%!4 = 0
- & icons%!8 = xmax% - xmin%
- ' icons%!12 = ymax% - ymin%
-
- M win%!4 = rove% - win%!4 :
- total size of window
- @ win%!8 = 1 :
- sprites
- C $buffer% =
- window$+
- (13)+ "Cy Booker", sizeof_hdr%-1)
- win%!12 = buffer%!0
- win%!16 = buffer%!4
- win%!20 = buffer%!8
- win% += sizeof_whdr%
-
- H !win% = 0 :
- flag last window
- FontH% = 1
- @ !buffer% = -1 :
- no fonts
-
- K !buffer% = rove% - buffer% :
- offset to font info
- &
- i%= 0
- sizeof_font%-1
- rove%!i% = 0
-
-
- i%= 1
- FontH%-1
- j% = 0
-
- j% += 1
-
- newfonts%?j% = i%
- A
- "Font_ReadDefn", j%, rove%+8
- ,, rove%!0, rove%!4
- ! rove% += sizeof_font%
-
-
- #
- i%= 4
- sizeof_hdr%-1
- buffer%!i% = 0
- 6
- "OS_File", 10, file$, &FEC,, buffer%, rove%
- free(newfonts%)
- free(buffer%)
- free(ind%)
- free(temp%)
- _Hourglass_Off
- simply turn it off
- _Hourglass_Off
- Hourglass%
- "XHourglass_Off"
- +M base% is for offset calculations, so 'rove% - base%' is an offset
- ,Z (actually, uses fact this points to window base. for background colour)
- -Q rove% points to memory buffer that gets filled with icons' extra data
- .1 flags% points to the icons' flag word
- /1 data% points to the icons' data words
- 0; alter% is
- if change text icon to anti-aliased
- 1= font$ is the name of the anti-aliased font to use
- 2C size% is the point size of the anti-aliased font to use
- 38 colours% is
- if check the validation string
- 4: uses the external 'UpdateBValidation%' boolean
- 5U Note: if UpdateBValidation% and alter% and indirected text and validation
- 6B string, then assume icons' bbox is stored at flags%-16
- _Relocate_Icon_Data(base%,
- rove%, flags%, data%, alter%, font$, size%, colours%)
- fore%, back%, do_it%, i%
- !flags%
- &040
- is anti-aliased
- <@
- (!flags%
- 1) = 0
- 1, "Anti-aliased font, no text!"
- _handle_font(flags%)
- >C
- alter%
- colours%
- ((!flags%
- &0000F000) < &0000E000)
- ?A
- _Alter_Font_Colours(flags%, base%?34, base%?35, data%)
- @
- not anti-aliased
- C.
- alter%
- ((!flags%
- &001) = &001)
- D-
- text, force it to be anti-aliased
- E%
- ((!flags%
- &100) <> 0)
- FQ
- is indirected, need to check if multi-line (can't be anti-aliased!)
- G# do_it% = (data%!4 <= 0)
-
- do_it%
- IG do_it% =
- _find_validation_string($(data%!4), "Ll", i%)
-
-
-
- not indirected
- M-
- but ignore "empty" text fields
- N! do_it% = ?data% <> 13
-
-
- do_it%
- Q) fore% = (!flags% >> 24)
- R
- (!flags%
- &020)
- S,
- filled background, so use it
- T+ back% = (!flags% >> 28)
-
- V/
- unfilled, use window background
- back% = base%?35
-
- Y0 flags%?3 =
- _Find_Font(font$, size%)
- Z!
- _handle_font(flags%)
- [/
- fore%=back%
- back% = fore%
- \$ !flags% = !flags%
- &040
-
- colours%
- ^?
- _Alter_Font_Colours(flags%, fore%, back%, data%)
-
-
- a
- (!flags%
- &103) > &100
- d
- indirected data exists
- e.
- _Relocate_Data(base%, rove%, data%!0)
- f0
- (data%!4 > 0)
- ((!flags%
- 1) <> 0)
-
- validation string
- h5
- UpdateBValidation%
- (flags% = data%-4)
- i9
- _Massage_Validation_String(base%, flags%-16)
-
- k0
- _Relocate_Data(base%, rove%, data%!4)
- l
- m
- (!flags%
- 3) = 2
- o> data%!4 = 1 :
- sprite pointer
- p
- t) icon% points to an icon block
- uS assume it is an indirected icon, with a valid validation string pointer
- vU this converts any "B"order validations to "R"iscOS3.10 border validations
- wU note that the validation string could be shortened, and the bbox updated!
- _Massage_Validation_String(base%, icon%)
- dx%, dy%, i%, j%, ind$, n$
- ind$ = $(icon%!24)
- _find_validation_string(ind$, "BbzZ", i%)
- ind$, i%+1, 1)
- ~)
- "0":dx% = 4 :dy% = 4:n$ = "R5"
- )
- "1":dx% = 8 :dy% = 8:n$ = "R3"
- )
- "2":dx% = 16:dy% = 16:n$ = "R6"
- +
- ((icon%!16
- &F000) >= &E000)
-
- writable icon
- , dx% = 8:dy% = 8:n$ = "R7"
-
- , dx% = 8:dy% = 8:n$ = "R2"
-
- )
- "4":dx% = 4:dy% = 4:n$ = "R2"
- )
- "5":dx% = 16:dy% = 16:n$ = "R7"
- )
- "6":dx% = 8:dy% = 8:n$ = "R7"
- )
- "7":dx% = 2:dy% = 4:n$ = "R1"
- )
- "8":dx% = 4:dy% = 4:n$ = "R1"
- B
- 1, "Unknown validation string (`"+
- ind$, i%, 2)+ "')"
-
- j% =
- ind$, ";", i%)
- j% = 0
- ! ind$ =
- ind$, i%-1)+ n$
-
- - ind$ =
- ind$, i%-1)+ n$+
- ind$, j%)
-
- $(icon%!24) = ind$
- icon%!0 -= dx%
- icon%!4 -= dy%
- icon%!8 += dx%
- icon%!12 += dy%
- icon%!16 = icon%!16
- base%!28 = base%!28
- e This routine maps the current (displayed) font handle to the external (saved) font handle
- ] flags% points to the icon flags word, so flags%?3 is the font handle that changes
- ' updates the global 'FontH%'
- _handle_font(flags%)
- external_FontH%, internal_FontH%
- external_FontH% = flags%?3
- 1 internal_FontH% = newfonts%?external_FontH%
- internal_FontH%=0
- internal_FontH% = FontH%
- FontH% += 1
- 3 newfonts%?external_FontH% = internal_FontH%
- flags%?3 = internal_FontH%
- 1 flags% points to the icons' flag word
- 1 data% points to the icons' data words
- 8 fore% is the desired foreground wimp colour
- 8 back% is the desired background wimp colour
- @ This is used to ensure fonts are displayed correctly
- P Ie we want to make sure that the icon has a "F"ont validation string
- 2 If one already exists, then do nothing
- Otherwise add one.
- K If not indirected then use two scratchspaces and alter the data
- ) uses temp% points to 13 bytes
- ) uses ind% points to 256 bytes
- 5 Note, may alter data%!0, data%!4, data%!8
- 9 Note, may alter !flags% (
- &100 = indirected)
- _Alter_Font_Colours(flags%, fore%, back%, data%)
- i%, found%
- ind$
- (!flags%
- &041)<>&041
- 1, "Attempt to change colour of non-anti-aliased text"
- ind$ = ""
- (!flags%
- &100)
- data%!4 > 0
- ind$ = $(data%!4)
- ; found% =
- _find_validation_string(ind$, "Ff", i%)
-
- P
- have to force icon to be indirected so can create a validation string
- found% =
- !flags% = !flags%
- &100
- F temp%!0 = data%!0 :
- copy text to safe place
- temp%!4 = data%!4
- temp%!8 = data%!8
- temp%?12 = 13
- 6 data%!0 = temp% :
- fake text
- G data%!4 = -1 :
- dummy validation
- @ data%!8 =
- ($temp%)+1 :
- size of buffer needed
- found%
- ind$ <> ""
-
- ind$, 1)<> ";"
- ind$ += ";"
-
-
- 9 $ind% = ind$+ "F"+
- colour(back%)+
- colour(fore%)
- data%!4 = ind%
- J returns a single-character string for the given wimp colour n%
- B this character is used in the "F"ont validation string
- colour(n%)
- "0123456789ABCDEF", (n%
- &0F) + 1, 1)
- C massages !data% to contain offsets rather than pointers
- * and places the data at rove%++
- _Relocate_Data(base%,
- rove%,
- data%)
- $rove% = $data%
- data% = rove% - base%
- rove% +=
- ($rove%)+1
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- dynamic memory routines
- this manages a heap above the workspace of basic
- automatically growing/shrinking as needed
- initmemory
- heap% 16
- heap%!0 = 0
- "CAssembler_Heap", 0, heap%, 32*1024
- calloc(
- p%, size%)
- "CAssembler_Heap", 5, heap%, size%
- malloc(
- p%, size%)
- "CAssembler_Heap", 1, heap%, size%
- free(
- "CAssembler_Heap", 2, heap%, p%
- p% = 0
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Debug%
- e$ = ", ["+
- )+ "]"
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- , Used to add a font to any window
- Y Ie it updates the global font count array (as used when loaded the templates)
- returns the handle
- ? Uses global `cache' of which fonts have been opened
- J Since we only ever have, at most, 2 fonts (title/icon) then no
- ; point using anything other than a linear search
- Q If don't use this cache, then if a template file has > 255 text icons
- 6 then we end up opening this too many times
- _Find_Font(name$, point_size%)
- handle%, found%, i%
- i% = 0
- found% =
- (i% < NFonts%)
- found%
- #J found% = ((name$ = FontName$(i%))
- (point_size% = FontSize%(i%)))
- found%
- i% += 1
- &
- found%
- )! handle% = FontHandle%(i%)
- +R
- "Font_FindFont",, name$, point_size%*16, point_size%*16, 0, 0
- handle%
- ,6
- Fonts%?handle% = 255
- 1, "Too many fonts"
- Fonts%?handle% += 1
- ." FontName$(NFonts%) = name$
- /( FontSize%(NFonts%) = point_size%
- 0& FontHandle%(NFonts%) = handle%
- NFonts% += 1
- = handle%
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- 7@ validations$ is the possibly empty validation string
- 8> find$ is a string of single characters (eg "FfRr")
- 9S This routine returns
- if any of the semi-colon separated fields of the
- :V validation string start (after any space) with a letter of the find string
- ;N If success then i% is the index (from 1) of the matching character
- _find_validation_string(validation$, find$,
- found%
- i% = 1
- A#
- validation$, i%, 1)=" "
- i% += 1
- C
- D' found% = (i% <=
- (validation$))
- found%
- F6 found% = (
- find$,
- validation$, i%, 1)) > 0)
- G
- found%
- I+ i% =
- validation$, ";", i%+1) + 1
- J
- found%
- (i% = 1)
- = found%
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- This scans the command line for parameters
- If none found then prompt user to edit program/use command line
- _define_constants
- b%, p%, C%, V$
- U! input_file$ = "$.Templates"
- V# output_file$ = "$.Templates1"
- W; Hourglass% =
- :
- boolean, show hourglass
- XP AlterTitle% =
- :
- force title font to be anti-aliased
- Y$ TitleFont$ = "Homerton.Medium"
- Z- TitleFontSize% = 12 :
- in points
- [O AlterIcon% =
- :
- force text icons to be anti-aliased
- \# IconFont$ = "Homerton.Medium"
- ], IconFontSize% = 13 :
- in points
- ^K CheckColours% =
- :
- ensure "F" validation string is ok
- _K UpdateBValidation% =
- :
- "b" translates to "r" validation string
- Extent% =
- IndSize% = 32 * 1024
- Sort% =
- "OS_GetEnv"
- "XOS_ReadVarVal", "ConvTmplt$Parameters", q%, -1, 0, 0
- ,, b%
- b% < 0
- fB
- _get_var_value(p$, "ConvTmplt$Parameters", q%, sizeof_q%)
- V$ = "Debug/s,Hourglass/s,Title/s,TFont/k,TSize/e,Icon/s,IFont/k,ISize/e,CheckColours/s,BValidation/s,Extent/s,IndSize/e,Sort/s"
- hA
- "XOS_ReadVarVal", "ConvTmplt$In", q%, -1, 0, 0
- ,, b%
- b% < 0
- jE
- _get_var_value(input_file$, "ConvTmplt$In", q%, sizeof_q%)
- kG
- _get_var_value(output_file$, "ConvTmplt$Out", q%, sizeof_q%)
- l8
- "XOS_ReadArgs", V$, p$, q%, sizeof_q%
- b% = q% - 20
- n
- oG
- "XOS_ReadArgs", "In/a,Out/a,"+ V$, p$, q%, sizeof_q%
- b% = q% - 12
- q#
- getz(input_file$, b%!12)
- r$
- getz(output_file$, b%!16)
- s
- t/
- (C%
- 1, p$:
- "Usage: "+ Usage$
- u(
- getb(Debug%, b%!20)
- v(
- getb(Hourglass%, b%!24)
- w(
- getb(AlterTitle%, b%!28)
- x(
- getz(TitleFont$, b%!32)
- y(
- geti(TitleFontSize%, b%!36)
- z(
- getb(AlterIcon%, b%!40)
- {(
- getz(IconFont$, b%!44)
- |(
- geti(IconFontSize%, b%!48)
- }(
- getb(CheckColours%, b%!52)
- ~(
- getb(UpdateBValidation%, b%!56)
- (
- getb(Extent%, b%!60)
- (
- geti(IndSize%, b%!64)
- (
- getb(Sort%, b%!68)
- _get_var_value(
- val$, var$, q%, sizeof_q%)
- len%
- "OS_ReadVarVal", var$, q%, sizeof_q%, 0, 0
- ,, len%
- ) q%?len% = 13 :
- terminate string
- val$ = $q%
- "OS_SetVarVal", var$, q%, -1, 0, 0
- geti(
- var, p%)
- var =
- geti(p%)
- geti(q%)
- q%=q%!1
- getb(
- var, p%)
- var = (var = 0)
- getz(
- var$, p%)
- var$ =
- getz(p%)
- getz(q%)
- ?q%>=32:V$+=
- (?q%):q%+=1:
- putz(A%,A$)
- $A%=A$:A%?
- (A$)=0
-