Hi Klaus, thanks for your time.
Klaus wrote:......
Record 1:
name -> Miller
firstname -> John
age -> 40
......
OK so far?
.........
Ok.
Klaus wrote:
....
Now HOW are the data organized when you retrieve them via Livecode?
Like this "en bloc":
MillerJohn46SmithWill15etc
???
No, the FIELDS and ROWs are of course DELIMITED, so we can differ the FIELDS and ROWs.
OK so far?
....
Ok.
Klaus wrote:
....
So we will get somethig like this when using the DEFAULT item and line delimiter:
Miller TAB John TAB 46 CR
Smith TAB Will TAB 15 CR
etc...
The DEFFAULT delimiters are TAB for delimiting the FIELDS and CR for delimiting the ROWs
OK so far?
....
Ok.... a little less,
I thought the delimiter character was already at the end of each field of the table. instead, if I understand what you say, the delimiter is set from the LC command by code.
Code: Select all
put numtochar(1) into tItemDel
put numtochar(2) into tLineDel
put revDataFromQuery(tItemDel,tLineDel,tDatabaseID,tSQL) into tRsTrovaDom
the code above don't say "GET DATA UNTIL
THAT CHARACTER" but "SEPARATE DATA
WITH THAT CHARACTER AND GIVE ME THE FIRST BLOCK" (item 1)
if the character was already in the table field....
Klaus wrote:
....
But this will not work if the FIELDS of the database already contain CRs as in your initial problem!
Do you know why?
Same if the database fields content already contain TABs!
Do you know why?
....
yes, I do hope, because the revdatafromquery LC command finding that character in the string goes in tilt and separates data when it should not.
the LC engine, knows where one field ends up. the delimiter character serves to me to use those data.
LC is all new for me, I used a little visual basic language, in which the reference to the tables fields is done by using the field names declared. something like this, straight from the query:
.................Recordset.name....Recordset.firstname....Recordset.age
record 1..........Miller.....................John.....................40
record 2......... Smith.....................Will......................15
to put the name into e text field:
textName.text = Recordset.name
well, due to my english I used an hour to reply, I hope to have written something understandable (not about concepts, but in grammar)
ciao
franco