1. FILEMAN.E
- Posted by Brian Jackson <bjackson at PRINTINGINC.COM> Feb 22, 1999
- 441 views
Well, sad to say I was ill all weekend, so FILEMAN.E remains unchanged. At this point, I am ready to begin re-writing it as per many of the suggestions proposed. The biggest change will be adding 1 extra byte to the length of each record, to manage deleted records. I checked into putting an ASCII 26 into the header of a file, but the only program which could not detect that there was more data in the file was the 'type' command in DOS, so I'm going to leave that be for now. I am adding versioning into the header, just in case. At this point, I think that the file format is set in stone now, but those are famous last words, so I'm using versioning anyway. The next update is a minor revision, so I won't be doing anything fancy like record-locking or indexing yet. This is mostly to lock in a file format that everyone is happy with, so I can convert my personal programs to FILEMAN, and write a few demos. If anyone has any last minute thoughts or comments, please let me know, as I should be converting the code this evening. Thanks, Brian Jackson
2. Re: FILEMAN.E
- Posted by Bernie Ryan <bwryan at PCOM.NET> Feb 22, 1999
- 457 views
Suggestion When you delete a record just overwrite a ~ (tilde) character over the first position in the deleted record. To compact the file all you have to do is find the first record in file that begins with ~ (tilde) and over write it with the next record if that record is deleted skip to the next record and etc. I hope you understand what I mean. This would be done in a buffer in memory and would be fairly fast. You could also use a filter that reads in a file and outputs a file while skiping the ~ (tilde) records. The advantage is speed, easy way to delete, and it doesn't cost a byte. Hope you feel better soon Bernie a good record until all deleted records are removed. By the way if
3. Re: FILEMAN.E
- Posted by Brian Jackson <bjackson at PRINTINGINC.COM> Feb 22, 1999
- 423 views
>When you delete a record just overwrite a ~ (tilde) character >over the first position in the deleted record. That was my initial thought as well, but once you overwrite a character in the record, you have no way to recover it. It will be a big pain in the neck to re-write FILEMAN this way, but it preserves the entire record for recovery later on. And if anyone is deleting lots of records from a file, it's probably going to get large enough that one extra byte in every record will hardly be noticeable. >To compact the file all you have to do is find the first record in file >that begins with ~ (tilde) and over write it with the next record if >that record is deleted skip to the next record and etc. I hope you >understand what I mean. This would be done in a buffer in memory and >would be fairly fast. You could also use a filter that reads >in a file and outputs a file while skiping the ~ (tilde) records. That's pretty close to what I had in mind. I won't overwrite deleted records, but there will be a command line utility (REFORMAT.EX) to purge all the deleted records from a file. Again, the advantage here is to be able to recover a deleted record (and it keeps the most recently written data in one spot at the end of the file). When the file gets too large, reformatting it will permanently erase all the deleted records and shrink the file size down. >Hope you feel better soon Thanks :) Brian Jackson
4. Re: FILEMAN.E
- Posted by Daniel Berstein <daber at PAIR.COM> Feb 22, 1999
- 448 views
I haven't look at Fileman.e but may I suggest you try to use xBase-like commands. In case you didn't knew, xBase is the term used to describe dBase like languages (like FoxPro, Clipper, Alaska, etc.) that use the .dbf file format (with some extensions). Purging deleted records is usually done with the pack command. If you want take a look at my dbf engine, it's available at RDS's contribution page. Regards, Daniel Berstein [daber at pair.com]
5. Re: FILEMAN.E
- Posted by Arlie Codina <web.master at FLASHMAIL.COM> Feb 23, 1999
- 432 views
Hi, I agree to Daniel Berstein. I'm a xBase programmer since 1991. I look forward to using FILEMAN.E. I was really hoping for someone to come up with routines that I can use to access Fox Pro 2 tables since I don't have the time to do it myself. But FILEMAN.E would be just fine. "I haven't look at Fileman.e but may I suggest you try to use xBase-like commands. In case you didn't knew, xBase is the term used to describe dBase like languages (like FoxPro, Clipper, Alaska, etc.) that use the .dbf file format (with some extensions)..." Daniel Berstein [daber at pair.com] Thanks to everyone who contributes to the list. You're all an inspiration for a Euphoria beginner like me. Regards, Arlie Codina web.master at flashmail.com
6. Re: FILEMAN.E
- Posted by Brian Jackson <bjackson at PRINTINGINC.COM> Feb 23, 1999
- 444 views
>[Arlie}I agree to Daniel Berstein. I'm a xBase programmer since 1991. >I look forward to using FILEMAN.E. I was really hoping for someone to >come up with routines that I can use to access Fox Pro 2 tables since >I don't have the time to do it myself. But FILEMAN.E would be just fine. > >[Daniel]"I haven't look at Fileman.e but may I suggest you try to use >xBase-like commands. In case you didn't knew, xBase is the term used to >describe dBase like languages (like FoxPro, Clipper, Alaska, etc.) that >use the .dbf file format (with some extensions)..." Well, guys, sad to say that I have absolutely ZERO experience with xBase, so I'd be out of my league trying to merge FILEMAN and xBase :( However, I may in the future have the time to check out Daniel's xBase routines (I think he has some on his site), and try to figure it out. Thanks for the suggestions :) Brian Jackson
7. Re: FILEMAN.E
- Posted by Arlie Codina <web.master at FLASHMAIL.COM> Feb 24, 1999
- 469 views
"Well, guys, sad to say that I have absolutely ZERO experience with xBase, so I'd be out of my league trying to merge FILEMAN and xBase :( However, I may in the future have the time to check out Daniel's xBase routines (I think he has some on his site), and try to figure it out. --Brian Jackson--" I'm enclosing a text on common xbase commands. I hope this will help. Regards, Arlie Codina web.master at flashmail.com oOo *** XBase Common Data Manipulation Commands *** CREATE - create or modify a table +-field name | +-field type | | +- example: 1234.67 <---width is 7 | | | +-------index file name | | | | Name Type Width Decimal Index FIRSTNAME CHAR 15 0 0 APPEND BLANK - adds a blank record to the end of the table and makes the blank record the current record. SEEK - searches for the first record in an indexed table whose key fields matches the specified expression or expression list. Syntax SEEK <exp> | <exp list> <exp> - the expression to search for in an index for a DBF table. <exp list> - one or more expressions, separated by commas, to search for in a simple or composite key index for non-DBF tables. REPLACE - replaces the contents of fields with data from expressions. Syntax REPLACE <field 1> WITH <exp 1> [ADDITIVE] [, <field 2> WITH <exp 2> [ADDITIVE]...] [<scope>] [FOR <condition 1>] [WHILE <condition 2>] [REINDEX] <field> WITH <exp> - designates fields to be replaced by the value of the specified expressions. Multiple fields of a record may be changed by including additional <field n> WITH <exp n> expressions, separated by commas. ADDITIVE - adds text to the end of memo field text instead of replacing existing text. You can use ADDITIVE only when the specified field is a memo field in a DBF table. <scope> FOR <condition 1> WHILE <condition 2> The scope of the command. The default scope is NEXT 1, the current record only. REINDEX - specifies that all affected indexes are rebuilt once the REPLACE operation finishes. Without REINDEX, Visual dBASE updates all open indexes after replacing each record in the scope. When replacing many or all records in a table that has multiple open indexes, REPLACE executes faster with the REINDEX option. SKIP - moves the record pointer in the current or specified work area. Syntax SKIP [<expN>] [IN <alias>] <expN> - the number of records Visual dBASE moves the record pointer forward or backward in the table open in the current or specified work area. If <expN> evaluates to a negative number, the record pointer moves backward. SKIP with no <expN> argument moves the record pointer forward one record. IN <alias> - the work area (file handle) in which to move the record pointer. USE - opens the specified table and its associated index and memo files, if any. Syntax USE [<filename1> [[TYPE] PARADOX | DBASE] [IN <alias>] [INDEX <filename2> [, <filename3> ...]] [ORDER [TAG] <.ndx filename> | <tag name> [OF <.mdx filename>]] [AGAIN] [ALIAS <alias name>] [EXCLUSIVE | SHARED] [NOSAVE] [NOUPDATE]] <filename 1> - the table you want to open. IN <alias> - the work area (file handle) in which to open the table. You can specify the work area that is being used by another table, in which case that other table is closed first. INDEX <filename2> [, <filename3> ...] - index file ORDER [TAG] <tag name> - AGAIN - opens a table and its related index files in the current or specified work area, leaving the table open in one or more other work areas. ALIAS <alias name> - an alternate alias name to assign to the table. EXCLUSIVE | SHARED - EXCLUSIVE opens the table so that no other users can open the table until you close it; SHARED allows other users access while the table is opened. NOSAVE - used to open a table as a temporary table. When you close a table opened with NOSAVE, it is erased along with its associated index and memo files. If you inadvertently open a table with the NOSAVE option, use COPY to save the data. NOUPDATE - prevents users from altering, deleting, or recalling any records in the table. INDEX - creates an index for the current table. APPEND FROM - copies records from an existing table to the end of the current table. Syntax APPEND FROM <filename> [FOR <condition>] [[TYPE] SDF DELIMITED [WITH <char> | BLANK]] [REINDEX] <filename> - the name of the file whose records you want to append to the current table. FOR <condition> - restricts APPEND FROM to records in <filename> that meet <condition>. You can specify a FOR <condition> only for fields that exist in the current table. SKIP - moves the record pointer in the current or specified work area. Syntax SKIP [<expN>] [IN <alias>] <expN> - the number of records Visual dBASE moves the record pointer forward or backward in the table open in the current or specified work area. If <expN> evaluates to a negative number, the record pointer moves backward. SKIP with no <expN> argument moves the record pointer forward one record. IN <alias> - the work area in which to move the record pointer. GO TOP - move record pointer to first record GO BOTTOM - move record pointer to last record GO <recno> - position record pointer to <recno> RECCOUNT() - returns the number of records in a table. Syntax RECCOUNT([<alias>]) <alias> - the work area you want to check. RECNO() - for DBF tables, returns the current record number. Syntax RECNO([<alias>]) <alias> - the work area you want to check.
8. Re: FILEMAN.E
- Posted by Arlie Codina <web.master at FLASHMAIL.COM> Feb 25, 1999
- 444 views
Hi Brian Jackson, More on common xbase commands. Arlie Codina web.master at flashmail.com *** XBase Common Data Manipulation Commands *** DELETE - deletes/mark records from the current table. Syntax DELETE [<scope>] [FOR <condition 1>] [WHILE <condition 2>] <scope> FOR <condition 1> WHILE <condition 2> The scope of the command. The default scope is NEXT 1, the current record only. DBF tables support the concept of soft deletes, where the record is marked as deleted and normally hidden when SET DELETED is ON (the default). If you SET DELETED OFF, you can see the deleted records along with the records that are not marked as deleted. You can RECALL the record to undelete it. To actually remove the record from the table, you must PACK the table. If you use the LIST or DISPLAY commands to display records, records marked as deleted are displayed with an asterisk. PACK - removes all records from a DBF table that have been marked as deleted. SET DELETED - controls whether dBASE hides records marked as deleted in a DBF table. Syntax SET DELETED ON | off Description Use SET DELETED to include or exclude records marked as deleted in a DBF table. When SET DELETED is OFF, all records appear in a table. When SET DELETED is ON, dBASE excludes records that have been marked as deleted, hiding them from most operations. INDEX, REINDEX, and RECCOUNT() aren't affected by SET DELETED. If two tables are related with SET RELATION, SET DELETED ON suppresses the display of deleted records in the child table. The related record in the parent table still appears, however, unless the parent record is also deleted. RECALL - restores records that were previously marked as deleted in the current DBF table. Syntax RECALL [<scope>] [FOR <condition 1>] [WHILE <condition 2>] <scope> FOR <condition 1> WHILE <condition 2> The scope of the command. The default scope is NEXT 1, the current record only. Description Use RECALL to undelete records that have been marked as deleted in the current DBF table with DELETE but have not yet been removed with PACK. Executing DELETE marks the record as deleted but doesn=92t physically remove them from the table. If SET DELETED is ON (the default), these deleted records cannot be seen. RECALL reverses this process, unmarking the records and fully restoring them to the table. Records eliminated with PACK or ZAP are permanently removed and can't be recovered using RECALL. When using RECALL, SET DELETED should be OFF; otherwise you will not be able to see the deleted records you want to recall. Using RECALL on records that are not marked as deleted has no effect. ZAP - removes all records from the current table. Syntax ZAP Description ZAP is the fastest way to delete all records from a table. DELETE ALL, followed by PACK, also deletes all records from a table. Using ZAP requires a table be opened exclusively.