Invalid item id?

67 views
Skip to first unread message

Scott Clift

unread,
May 12, 2021, 12:18:12 PM5/12/21
to jBASE
When selecting all the items in a file, and then saving the results of the select,  there is a item ID that looks odd.

The ID appears as .4................ in the list.

Looks like jbase tries to open item number 4, which doesn't exist.

Any ideas on how to delete this seemingly junk item?

Richard Kann

unread,
May 12, 2021, 12:24:59 PM5/12/21
to jb...@googlegroups.com, Scott Clift

Is it possible you have a bad item id in the file containing revered control characters? If you do a list of the file do any odd looking id's show? You may not be able to edit them too just as an fyi as the select may only be pulling part of the bad id if due to control chars like vlaue marks, attr marks, orctr-J ctrl-L etc.

--
--

--

Richard Kann

cwslogo

Comp-Ware Systems, Inc.
phone: 800-494-7671
email: rk...@comp-ware.net
www.comp-ware.net

bdeck...@gmail.com

unread,
May 12, 2021, 1:03:03 PM5/12/21
to jBASE
This code might be helpful.  It is run as check_keys <fileName>

sentence=CHANGE(@SENTENCE,SPACE(1),@AM)
PROMPT \\
i=0
fileName=sentence<2>
OPEN fileName TO hdl.fileName ELSE STOP 201, fileName
SELECT hdl.fileName TO cursor
done = @FALSE
LOOP UNTIL done DO
   READNEXT id.fileName FROM cursor THEN
      i++
      IF id.fileName NE OCONV(id.fileName, \MCP\) THEN
         CRT \Bad: HEX(id)=\:OCONV(id.fileName, \MX0C\):\ | MCP(id)=\:OCONV(id.fileName,\MCP\):\ -- DELETE?\:;INPUT yn
         IF OCONV(yn[1,1],\MCU\) EQ \Y\ THEN
           DELETE hdl.fileName, id.fileName
           CRT \deleted.\
         END
      END
   END ELSE
      done = @TRUE
   END
UNTIL done DO REPEAT
CRT i:\ keys checked\

Message has been deleted

Scott Clift

unread,
May 12, 2021, 1:03:18 PM5/12/21
to jBASE
Yes, the name of the ID is probably somethin else, but there are over 8,000,000 records in the file, so it might be tough to catch by listing the items.

My only other thought is to select the whole file, and remove this item from the list, and then copy all other items to a new file.

Scott Clift

unread,
May 12, 2021, 9:27:50 PM5/12/21
to jBASE
The program idea was great, thanks!

I got it sorted out based on that.

bdeck...@gmail.com

unread,
May 13, 2021, 11:22:50 AM5/13/21
to jBASE
Glad it helped.
Reply all
Reply to author
Forward
0 new messages