I am trying to test LETODB. I started from the info on this page: http://bielsys.blogspot.be/2008/07/leto ... -para.html
It is in spanish (no problem for me).
In order to compile the example program, one has to 'link RDDLeto.lib'.
This file in included in the zip download.
What is the procedure to link this lib when compiling? I am using build.bat to compile.
This may seem a stupid question, but I consider myself still a beginner with HMG.
Thanks
Richard
this is the (slightly adapted) code from the example (it is provided as a picture in the article)
Code: Select all
// letotest
#include "hmg.ch"
function main()
local cServer:='//127.0.0.1:2812/' // IPadress of server
REQUEST LETO
RDDSETDEFAULT("LETO")
if Leto_Connect(cServer)==-1 // is the server listening?
MsgStop("No connection with server " + cServer, "Attention!" )
return nil
else
MsgStop("Server is listening " + cServer, "Attention!" )
endif
dbcreate(cServer + 'test1',{{'field1','N',3,0},{'field2','C',15,0},{'datum','D',8,0}}) // creating table
dbusearea(.T.,,cServer + 'test1','test1') // open table
index on field1 TAG field1 // create index
for i=1 to 100 // create 100 records
test1->(RLock())
test1->(DBAppend())
test1->field1:=i
test1->field2:='Record '+ str(i,3)
test1->datum:=date()
test1->(DBUnlock())
next
test1->(DBSeek(50))
MsgStop(test1->field2, "Result!" )
test1->(DBCloseArea())
return nil