home *** CD-ROM | disk | FTP | other *** search
- *****************************************************************
- FUNCTION ISMEMO (filename)
- *****************************************************************
-
- * Description
-
- * Copyright(c) 1991 -- James Occhiogrosso
-
-
- LOCAL buffer := ' ', handle := 0, ret_value := -1, memofile := ''
-
- * Add DBT extension for memofile.
-
- IF AT(".", filename) > 0
- memofile = SUBSTR(filename,1,AT('.',filename) - 1) + '.DBT'
- ELSE
- * If no extension passed, default to DBF and DBT
- memofile = TRIM(filename) + ".DBT"
- filename = TRIM(filename) + ".DBF"
- ENDIF
-
- * Open database file as read only
- handle = FOPEN(filename , 0)
-
- * If no open error, read the first byte
- IF FERROR() = 0 .AND. FREAD(handle, @buffer, 1) = 1
-
- * The first byte of a dBASE III file is 131 if memo fields
- * are defined, or 03 if no memo fields defined. If neither
- * is true the file is not a dBASE III database and the
- * default return value of -1 is returned.
-
- * Check for memo code in buffer.
- IF buffer = CHR(131)
- * File is dBASE III file with memo fields
- ret_value = 1
-
- ELSEIF buffer = CHR(03)
- * File is dBASE III file without memo fields
- ret_value = 0
-
- ENDIF
- ENDIF
-
- * Clean up and return
- FCLOSE(handle)
- RETURN(ret_value)
-
-
-
-
-