Show all found records

Martin Kloss martin.kloss at gmx.de
Tue Dec 9 19:30:15 CST 2003


At 18:48 09.12.2003, you wrote:
>I am a new Valentina user and I am also using Director. If anyone knows a 
>bit of Lingo together with Valentina I would really appreciate some help.

Hi Richard,

it seems you should better read all the Director & Valentina docs and
study the example files, before you start with your own project. Some
things in your code are really confusing and you're using very outdated
Lingo, like the "set" statement, which has been deprecated a couple of
years now.

Like Ruslan said, you're creating a cursor, which potentially contains
more than one record, so you should test for the record count and decide
what to do with the records, i.e. display them in a text field.
For example you could write a simple handler to display all field values
for a cursor in a text field:

on displayRecords (myCursor, myField)

   res = ""
   recordCount = myCursor.GetRecordCount()
   repeat with i = 1 to recordCount
     put myCursor.GetField("title") after res
     if i < recordCount then put RETURN after res
   end repeat
   return res

end displayRecords

and then create your cursor and display the results in your field:

SQLstring = "select * from record WHERE title LIKE '\A" & value & "' no_case"
myCursor = new ( xtra "VCursor", GetRef(gMyDataBase), SQLstring, kServer, 
kReadWrite, kRandom)
member("ftitle").text = displayRecords(myCursor, "title")

Maybe that helps a little, but I really recommend you study the
docs and get a good book on Director.

Martin.




More information about the Valentina mailing list