Problems with EDB
- Posted by evanmars Feb 06, 2014
- 2430 views
With this small program:
include std/eds.e include std/io.e include std/text.e db_create("Test.edb",DB_LOCK_NO) db_create_table("Table1",DB_LOCK_NO) atom fn object KeyName sequence Data1, Data2, Data3 integer result sequence file_name fn = open("Test1.txt","r") while 1 do KeyName = gets(fn) if atom(KeyName) then exit end if KeyName = KeyName[1..$-1] Data1 = gets(fn) Data1 = Data1[1..$-1] Data2 = gets(fn) Data2 = Data2[1..$-1] Data3 = gets(fn) Data3 = Data3[1..$-1] if db_find_key(KeyName) < 0 then result = db_insert(KeyName,{Data1,Data2,Data3}) printf(1,"db_insert: %d\n",result) end if end while close(fn) while get_key() != 'n' do end while
I get this error:
c:\Euphoria\include\std\eds.e:2181 in function db_insert() repetition count must not be less than 0 ... called from C:\Users\evanmars\Programming\Eu\Programs\EuBrew\TestDB.ex:30 --> See ex.err Press Enter...
Test1.txt contains:
Key1
Data1
Data2
Data3
Key2
Data4
Data5
Data6
Key3
Data7
Data8, Data9
Data10
Key1
Data1
Data2
Data3