\ BOOKMARK.SEQ Mark your place in a file, to come back to. comment: Jerry Modrow had a bright idea that it would be nice to be able to mark your place in a file, such that you could go back to that place at a later time after having done a VIEW. This is an implimentation of that concept. comment; 5 constant #marks create markhandles #marks b/hcb * allot create marklines #marks 2* allot : clr_marks ( --- ) \ Clear the Book Marks markhandles #marks 0 do dup clr-hcb b/hcb + loop drop marklines #marks 2* erase ; clr_marks \ Initialize Book Marks to empty : mark_init ( --- ) \ Clear Book Marks at Cold Start time defers initstuff clr_marks ; ' mark_init is initstuff : makemarkset ( n1 --- ) \ Creates the Set Mark words dup #marks >= abort" No more room to create marks!" create , does> @ dup 2* marklines + loadline @ swap ! b/hcb * markhandles + shndl @ swap b/hcb cmove ; 0 makemarkset m1 \ Three Book Marks for now 1 makemarkset m2 2 makemarkset m3 3 makemarkset m4 4 makemarkset m5 : returntomark ( n1 --- ) \ Creates the Back to Mark words dup #marks >= abort" No more room to create marks!" create , does> @ dup b/hcb * markhandles + dup >hndle @ 0 < abort" No Mark to return to." $hopen abort" Error going back to Mark!" 2* marklines + @ loadline ! ; 0 returntomark bm1 \ Three Back to Mark words 1 returntomark bm2 2 returntomark bm3 3 returntomark bm4 4 returntomark bm5