dbTalk Databases Forums  

adarray[] to table

comp.databases.paradox comp.databases.paradox


Discuss adarray[] to table in the comp.databases.paradox forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
joseph gimeno
 
Posts: n/a

Default adarray[] to table - 01-26-2006 , 05:48 PM






thanks for your tip. But how do I attach a tCursor to an array and step
thru...how can you scan tCursor in an array?
since I don't know and already tried different approaches including
tCursors, I thought I ask....

Reply With Quote
  #2  
Old   
Egbert Babst
 
Posts: n/a

Default Re: adarray[] to table - 01-26-2006 , 06:55 PM






Joseph,
Rodney offered a useful code as an example.
You might have missed it.
I copy and comment the code for you in "{...}":
Rodney's code >>>
I'd simply open a tCursor to the Table and add the Array Data using a Loop.

Untested Example:
;--begin-----------------------------------
;--------------------------->
Var
tc tCursor
liTicker longInt
arFiles Array[] String
endVar
;<---------------------------
{Assuming you want to store the results of the filebrowser in the
existing table "C:\\MyTableName.db".
The tcursor "tc" is a pointer to (elements of) this table. Next line
will combine the tc with the table}
tc.open("C:\\MyTableName.db")
if arFiles.size() > 0 then
liTicker = 1
tc.edit()
{He's now parsing all elements of the array and inserts a new record
for each element into the table.
You could also do this with a for ... next loop.}
While liTicker <= arFiles.size()
{He inserts a new empty record into the table:}
tc.insertRecord()
tc."MyFieldName" = arFiles[liTicker]
{The field "MyFieldName" - you would change this of course to your
needs - contains now the actual element of the array.
I would add here this line:
if NOT tc.unlockRecord() then errorShow() quitLoop endIf}
liTicker = liTicker + 1
endWhile
tc.endEdit()
{And add: tc.close()}
endif
;--end------------------------------------------
<<<
I would say Rodney already answered your question, didn't he?

Egbert, 01:55 AM in Germany


"joseph gimeno" <joe.jrc (AT) alaska (DOT) net> schrieb im Newsbeitrag
news:43d95fd6 (AT) news (DOT) acsalaska.net...
Quote:
thanks for your tip. But how do I attach a tCursor to an array and step
thru...how can you scan tCursor in an array?
since I don't know and already tried different approaches including
tCursors, I thought I ask....



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.