George: Looks to me if LOC Line nr is lower than the Cursor set by FIND/CHANGE/EXCLUDE loc is a NOOP . Seems that LocNext is done . Is following code in LocSearch correct ? IF IsLfFirst OR IsLfAll THEN ' If FIRST/ALL then start as the top LocLine = 1: LfClear(%LocFirst): LfSet(%LocNext) ' Remove so we do it just once END IF ' even a find xxx;LOC :TAG FIRST is a NOOP when Tag is before the found line . Thanks
MUEH: a) Thanks for the hint, got me on the right track. b) However, the LocSearch code IS correct (in fact in this scenario, LocSearch is not even used) c) Error was in CurSetReq, and the error may account for a variety of other bad cursor positioning cases. d) Fix consists in changing one line - from using variable "A" to using variable "B" - your challenge for the day.
Thanks George . 22342 solved the LOC NOOP problem . When saving my new (Empty) test file by end of SPFLite i discovered obscure data loss problem . Problem occures only when Empty file with Label and Tags as shown on same line is saved . Tag :T is on line 2 6 10 and label .A on line 2 and .B on line 6 . The saved file has the first 4 lines lost . No Problem when create or saveas is done . is there different code used during termination to save file ?
Robert: I already have two utilities Flatten.EXE and UnFlatten.EXE. When I want to edit the SPFLite source in one SPFLite session, I run it first, it creates an SPFLite.Flatten file to be edited. When I'm done, UnFlatten puts it all back to the normal individual files. Both run in basically a 'blink'.
The only change to the source needed is to alter all the #INCLUDE statements of stuff like API headers to include the ONCE KW. If ONCE is coded, the Flatten program will NOT expand it in the output file, it just leaves it as a normal #INCLUDE statement. Gad! Last thing you need is a couple hundred thousand lines of API headers.
If you'd like them, I'll send them. They'd need tweaking as they are set up internally with specific SPFLite filenames.
George: Since 22337 there is a problem that LOCATE doesn't set .ZLOC . ON sample file issue LOC 2 . f ' ' 1 .ZLOC results in Line reference .ZLOC is undefined Thanks
MUEH: I cannot get any data loss with your scenario. I tried SAVEAS - worked. I tried SAVE - worked. I tried END, replied Yes to the SAVE prompt - worked.
George: The Data loss problem during END when saving Data get's complicated . First i thought it's permanennt but then i couldn't reproduce it . Here a detailed test scenario which you shoul repeat maybe 10 times . Put following test data into CB . then open NEW file and issue PASTE cmd to get Data fron CB . issue following cmd to set tag and labels . tag :T 2;tag :T 6;tag :T 10;line ".A" .2;line ".B" .6 Enter .C label on line 4 manualy (must be done otherwise i didn't get error) Press pfk3 for end Click on SAVE and enter file name to save it . view the file and you should see the the records 1-4 are lost . If you can't reproduce i will give up .