A86: Re: Re: BASIC & inverts! HELP!


[Prev][Next][Index][Thread]

A86: Re: Re: BASIC & inverts! HELP!




You need to find all vars on the calc of type program.  I haven't done this
much, so there's probably a much better way, but a loop like this should
work.  My question for you rom call gurus, is there a call to sequentially
search the VAT?  Seems kind of silly to search the whole VAT for the next
matching name, then search it again to pull up the found name:

 ld hl,StartingName       ; init the loop
 rst 20h                  ; copy name to OP1
VATSearchLoop:
 sub a                    ; clear A -- search only program vars
 call _FindAlphaUp        ; find next matching name in the VAT
 jr c,DoneSearchingVAT    ; if carry, then we're at the end
 rst 10h                  ; grab name from the VAT (_FINDSYM)
 call _ex_ahl_bde         ; _FINDSYM returns in AHL, swap to BDE
 call _check_asm          ; is it an asm program?
 jr z,VATSearchLoop       ; we can skip those
 call _get_word_ahl       ; copy the first to bytes to DE (we can skip that)
 call _get_word_ahl       ; get next two bytes
                          ; yeah, this part sucks, but I'm lazy :)
 ld a,'t'                 ; 't'
 cp e                     ; check first char
 jr nz,VATSearchLoop      ; didn't find it, continue loop
 ld a,'e'
 cp d
 jr nz,VATSearchLoop
 call _get_word_ahl
 ld a,'x'
 cp e
 jr nz,VATSearchLoop
 ld a,'t'
 cp d
 jr nz,VATSearchLoop

; when you get here, you should have one of your programs
; you're on your own :)

StartingName:
 .db $12,1,0



>
> Okay, the Text Editor program, available at ticalc.org works like this.
> Say you write a BASIC prog like this
>
> PROGRAM: TEST
> :edit
> :Welcome to the Editor
>
> Then, the editor reads for the first line to be "edit".  If it is, then
> it shows up in the menu bar of the Text Editor program, and all text
> after the command "edit" is converted to small font.  I'm trying to find
> out how this works, but I have no idea how the asm prog, Text Editor,
> searches for that line in the BASIC progs on your calc, because you can
> have as many Text Editor files as you want.  If anyone understands now,
> please HELP!




Follow-Ups: References: