home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload
/
ShartewareOverload.cdr
/
database
/
dedit.zip
/
CREATOR.PRG
< prev
next >
Wrap
Text File
|
1986-06-22
|
2KB
|
93 lines
clear
store space(10) to datafile
do while datafile = space(10)
clear
@ 6,10 say "Name of DBF file to Create? ";
get datafile picture "!!!!!!!!"
read
clear
store datafile+".DBF" to d1
enddo
Create temp
Text
The system has just created a DBF which will contain the structure
of the actual DBF that you are creating. Please enter the file
structure information.
Field_name - Can be up to 10 characters in length.
Must start with a letter, and can contain
letters, numbers, and underscores. Blank
spaces are not allowed in field names.
Field_type - C Character Data up to 256 characters
D Date Data in form MM/DD/YY
N Numeric Data
L Logical Data (Y,N or T,F)
M Memo Field for Text Storage
Field_lenght - Number of spaces for data in record
Decimals - Valid only for numeric fields
endtext
store 1 to rn
do while rn > 0
store -1 to rn
@ 16,10 say "Record number to edit " get rn picture "99999"
@ 17,10 say "( 0 to exit / <negative> # to append)"
read
clear gets
if rn = 0
loop
endif
use temp
store "EDITING " to wrd
* appending
if rn < 0
append blank
go bottom
store RECNO() to rn
store "ADDING TO " to wrd
endif
go top
if EOF()
@ 12,10 say "File is empty and cannot be edited."
return
endif
go bottom
if rn > recno()
@ 12,10 say "Record number exceeds records in file. "+;
"Editing Last Record"
store recno() to rn
endif
goto rn
clear
store 2 to row
@ 1,0 say wrd+"file "+"TEMP "+".DBF Rec # "+str(rn,5)
for I = 1 to 1024
if row > 22 .or. "" = fieldname(I)
store 2 to row
read
clear gets
@ 2,0 clear
endif
if "" = fieldname(I)
store 1025 to i
loop
endif
@ row,1 say fieldname(I)
store fieldname(I) to fld
@ row, 13 get &fld
do case
case type(fieldname(I)) = "C"
if len(&fld) > 66
store row + int(len(&fld)/66) +1 to row
else
store row+1 to row
endif
otherwise
store row+1 to row
endcase
next i
@ 2,0 clear
enddo recordno
Create &datafile from Temp.dbf
Use &datafile
list structure
wait