home *** CD-ROM | disk | FTP | other *** search
- dBASE II FREQUENT QUESTIONS
-
- 1 Programming
- 2 Printing
- 3 Data transfer
- 4 REPORT form
- 5 INDEXing and SORTing
- 6 Lost records
- 7 Memory allocation
- 8 Data File Size limitation
-
-
- 1 Programming
-
- What else do I need to know about using other text editors to
- create command (.CMD or .PRG) files?
-
- The editor or word processing program must be used in a
- mode that does not insert control characters in the
- text for page breaks, line feeds, etc. In WORDSTAR,
- for example, use the "N" (Non-document) option rather
- than the "D" (Document) option. A useful side note is
- that you can run dBASE II from the "R" (Run a program)
- option in WORDSTAR for testing your program.
-
-
- How can you FIND on more than one key? I have indexed my
- database on Last:name + First:name to <indexfile>, but I can
- still only find the Last:name.
-
- If your Last:name field is 12 characters wide and you
- have the name, Smith, in it, it would have the five
- characters of the name plus seven spaces. The index
- key would therefore have seven spaces between the end
- of the last name and the start of the first name.
- The index key would look like this:
-
- SMITH JOHN
-
- In order to FIND this record, you would have to state
- the command in a way that included the exact number of
- spaces:
-
- FIND "SMITH JOHN"
-
- Although that works, it is hardly practical in the real
- world. Usually, you would enter the name you want to
- FIND into memory variables and you would find on the
- macro of the variables. Also, you would not want to be
- concerned with counting the required number of spaces.
- If you use @...GETs to prompt for the names, just
- initializing the variables to the appropriate length
- will provide you with the correct number of trailing
- spaces. For Example:
- *Initialize variables
- STORE " " TO mlast, mfirst
- *Get string to search for
- @ 1,1 SAY "First name " GET mfirst
- @ 1,40 SAY "Last name " GET mlast
- READ
- *Concatenate the variables and find key
- STORE mlast + mfirst TO mkey
- FIND &mkey
-
- When I have written a command file and it doesn't run the way it
- should, is there any way to find out exactly what the trouble is?
-
- SET ECHO ON and SET TALK ON, and run the program. If
- the screen gets too cluttered for you to follow, SET
- DEBUG ON will send the output of ECHO and TALK to the
- printer. This is dBASE II 's primary debugging tool and
- it is the only way you can really see how your command
- file is being executed and what the results of each
- command are. SET STEP ON allows you to proceed one
- command at a time and even enter commands from the
- keyboard during the program's execution.
-
-
- I just updated to version 2.43 and am getting the error message,
- FILE IS CURRENTLY OPEN. These very same program files ran
- perfectly under version 2.3. Why don't they run in 2.43?
-
- This is a new feature in 2.4 that prevents you from
- getting into bigger trouble further down the line. It
- prevents recursion which is the calling of the same
- command file from within itself or calling another
- command file which then calls the first one. DOing
- another command file does not close the one you are in;
- only a RETURN will close command files. It's good
- housekeeping to place a RETURN command at the point
- where you want to exit from your command file even when
- there is no other file to which to return. You will
- also run into this new feature if you try to APPEND
- FROM or COPY TO a file that is open in SECONDARY when
- you are in PRIMARY, and vice versa.
-
- I made an entry screen using @..SAY..GETs and READ in a DO WHILE
- loop. It works fine for nine times through the loop and then the
- cursor goes way over to the right of the screen and hangs the
- machine. What causes this?
-
- You must either ERASE or CLEAR GETS every 64 GETs or
- you will experience this or other difficulties. It's a
- good practice to place a CLEAR GETS within any loop
- which contains even one GET, and anywhere in the file
- where 64 GETs could possibly occur. You may also use
- the CLEAR GETS after any READ where you don't want the
- operator to be able to move the cursor backwards into
- previous GET fields.
-
-
- 2 Printing
-
- To use my printer's special functions, I have to send special
- characters like the ESCape. Can I do that from within dBASE II?
-
- You can send the decimal equivalent with the CHR
- function. An ASCII conversion chart will assist you in
- this. The decimal equivalent for ESC is 27. To send
- it, you SET PRINT ON and type: ?? CHR(27). If you want
- to send a sequence, use the plus sign to concatenate
- the CHR statements, ie: ?? CHR(27)+CHR(62)+CHR(34).
- You programmers who are used to BASIC please note that
- there is no dollar-sign in the dBASE II function. We
- use CHR(27), not CHR$(27). CHRs may also be sent with
- the @...SAY function if you SET FORMAT TO PRINT.
-
- When I'm printing from a data file, the last line of the last
- record doesn't print until I QUIT out of dBASE II. What causes
- this and what can I do to get the last line to print?
-
- Many printers have a buffer in which they store each
- line until they receive a carriage-return. dBASE II
- sends it's carriage-return/line-feed pair at the
- beginning of a line rather than at the end. So when
- you get to the last line of the last record, the
- printer is waiting for a carriage-return before it
- prints that line. It's a simple matter to send the
- printer a carriage return in the form of a CHR(13) at
- the end of any printing job in which this occurs. For
- operations where you have SET PRINT ON, use "??
- CHR(13)", and for operations where you have SET FORMAT
- TO PRINT, use "@ <coordinates> SAY CHR(13)".
-
-
- 3 Data transfer
-
- What data formats will dBASE II accept so that I can use data
- from other programs without retyping it?
-
- dBASE II can read data files that have been created by
- other processors and systems like BASIC, PASCAL,
- FORTRAN, PL/I, etc. if the files are stored in ASCII
- code (American Standard Code for Information
- Interchange). The APPEND command with the SDF or
- DELIMITED options is the way to do this. Check your
- dBASE II User Manual on pages A-47, B-19, and B-41 for
- the proper syntax.
-
-
- Can I use the information in my dBASE II .DBF file with a mailing
- list or word processing program?
-
- Yes. One command will convert the .DBF file to System
- Data Format (ASCII) or a Delimited format. Use the
- COPY command with the SDF or DELIMITED options to do
- this. Look up the COPY command on pages A-47, B-19,
- and B-53 in your dBASE II User Manual for the proper
- syntax in making this conversion.
-
-
- 4 REPORT form
-
- What are the limits of the REPORT FORM command?
-
- REPORT FORM will process a maximum of 24 fields. All
- column headings combined are 720 bytes maximum. Page
- heading is 254 bytes maximum. When you include logical
- fields in a report form, they will always take up eight
- characters of space at output, even though you may
- define the report field's width as one. If the REPORT
- FORM command cannot generate a printout for a specific
- application, create a command file and use the @...SAY
- commands with SET FORMAT TO PRINT.
- You may change the file with any text editor. To change
- it with MODIFY COMMAND, just use the .FRM extension with
- the file name (ie: At the dot prompt, type:
- MODIFY COMMAND <FILENAME>.FRM).
- Since the questions that prompted you through the
- original creation of the file are not contained in the
- file, you will find it helpful to have your printer on
- when you originally create the file. That way, you
- will have a hard copy of the questions to guide you
- through the changes. A word of caution though, if you
- make any errors in editing the .FRM file by this
- method, the REPORT FORM command will bomb since there
- is no trapping of errors as when the file is first
- created in dBASE II . If you escape a REPORT FORM
- either by hitting the ESC key or by getting a syntax
- error, you must close it before you can edit it with
- MODIFY COMMAND. REPORT FORM files are closed only when
- the data file (.DBF) they USE are closed.
-
-
-
- 5 INDEXing and SORTing
-
- On very large files, the SORT command seems to take a long time.
- What can I do to make it faster and easier?
-
- Use the INDEX and COPY commands to accomplish the same
- result as a SORT in less time and with more
- versatility. For example:
-
- USE <original file>
- INDEX ON <some key> TO <index file>
- COPY TO <sorted file>
-
- Is there any way to estimate the size of an index (.NDX) file
- before actually creating it?
-
- The approximate size in bytes can be determined with
- the following formula:
- Let x = key size; let y = number of records.
- 1.4*(INT(y/INT(512/(x+4)))*512)
-
-
-
- 6 Lost records
-
- I have a .DBF file that says it has 100 records in it when I
- LIST FILES or LIST STRUCTURE. But when I try to simply LIST the
- contents of that file, it only shows me 32 records. I know there
- are 100 records because I entered them. Is this a bug in dBASE
- II?
-
- No, it is an embedded EOF (End Of File) marker. There
- is only one cause of an embedded EOF marker in version
- 2.4 and that is when you exit from dBASE II without
- issuing a QUIT command, and therefore are not closing
- the files that are open. The EOF marker is not removed
- from its prior position, and any recently entered data
- may be either lost or irretrievable. This happens most
- often when there is an inadvertent system reset during
- a working session, or when you change the disk without
- properly closing the files. You should never
- intentionally exit dBASE II without issuing the QUIT
- command to close the files.
- You may think that you have closed the files when, in
- fact, they remain open. This usually happens when you
- are working in PRIMARY and SECONDARY and you issue a
- USE <blank> command to close the files. If you are in
- PRIMARY, a USE command will only close the PRIMARY
- file. And similarly, if you are in SECONDARY, a USE
- command will only close the SECONDARY file. A CLEAR
- command will close all files (it also releases your
- memory variables and selects primary), or you can
- SELECT PRIMARY and USE <blank> and then SELECT
- SECONDARY and USE <blank>.
- To recover data in a file with a misplaced EOF marker,
- you have to reconstruct the file using the COPY and
- APPEND commands. Reminder: always have a backup copy
- of any file on which you are working.
-
- USE <Sickfile>
- COPY TO <Goodfile>
- GO # + 2
- COPY NEXT 65535 TO <Tempfile> (copies last portion)
- USE <Goodfile>
- APPEND FROM <Tempfile>
- DELETE FILE <Tempfile>
- DELETE FILE <Sickfile>
- CLEAR
-
- You can now RENAME your good file. If there is more
- than one embedded EOF, you may modify this routine to
- copy out the data between EOFs, or change line three
- to read: GO # + <n> -- where n is a number large enough
- to get you past all the embedded EOFs.
-
- Why do I get the error message RECORD OUT OF RANGE when the
- record is within the range of the beginning and ending record
- numbers?
-
- This will happen in an INDEXed file if the INDEX has
- become corrupted or if you have a misplaced EOF marker.
- REINDEX your file, and if that does not clear up the
- problem, follow the procedure outlined above. You could
- also have a corrupted file header which is usually easily
- cleared up by COPYing STRUCTURE TO <newfile>, USE <newfile>,
- and APPEND FROM <oldfile>. This condition can also
- occur when you APPEND records and SORT without closing
- your file between those operations (See #35 below).
-
-
-
- 7 Memory allocation
-
- If I have more RAM memory than the minimum required, will dBASE
- II use it?
-
- No. dBASE II uses a fixed amount of memory regardless
- of how much may be present. dBASE II uses to B000H (45056D)
- on 8-bit systems, and to EB00H (60160D) on 16-bit systems
- for everything except the SORT command. SORTs use a fixed
- amount of the area above that and below the start of BDOS in
- 8-bit systems, or below 92K in 16-bit systems.
-
- What dBASE II files must remain on the disk? Can I remove any
- to make more room?
-
- In version 2.4 or greater of dBASE II, there are only two
- files that must remain on the disk, DBASE.COM and
- DBASEOVR.COM. The third file, DBASEMSG.TXT, may be
- removed if you will not be using the on-line HELP
- feature. Of course, INSTALL.COM may be removed once
- you have installed dBASE II for your terminal.
-
- 8 Data File Size limitation
-
-
- Current file size limit of dBASE II for all versions is 8
- megabytes. This limit applies to both the 8- and 16-bit formats.
- MS-DOS allows for files to be as large as 32 megabytes, but dBASE
- II cannot handle a file this large.