show file in table

show file in table

Post by YmlqYW » Tue, 23 Aug 2005 02:07:01


Hi
I make 50 index on my table and I want show this index file in a table for
example I have this index file on my table
1.idx,2.idx,3.idx €. 50.idx
And I want show the name of this index on a new table (maybe in a courser )
and after that I can brow this table and see indexes I made
Thank you
 
 
 

show file in table

Post by Stephen & » Tue, 23 Aug 2005 07:25:57

If your indices are tags within a single cdx file you could use this
routine:

Close All
Create Table Indexes (TAGNAME c(10), Expression c(100))
Use <your table name>
lnTOTAL = Tagcount()
For lnCOUNT = 1 To lnTOTAL
lcTAG = Tag(lnCOUNT)
lckey = Key(lnCOUNT)
Insert Into Indexes Values (lcTAG, lckey)
Next
Select Indexes
Browse

However if you are holding separate idx files, 50 of them, for the table,
you would need to set the index, (and to do this you would obviously know
the index name) and then use SYS(14) to obtain the index expression. You
could then insert a record into a table that you have created, e.g. INDEXES
in the example above, and store the index name in one field, and the result
of SYS(14) into the other field.

Sincerely

Stephen

 
 
 

show file in table

Post by YmlqYW » Tue, 23 Aug 2005 13:46:01

Hi
Thank you for your help but
It don help me I repeat my question in another way.
I have a directory with 1000 files and I want put files with extension Idx
to a table and see it I don know the name of idx file I only know the name
of extension files in other way I want filter files with idx extension and
put them in a table and brow it
Thank you
 
 
 

show file in table

Post by Fred Taylo » Tue, 23 Aug 2005 17:06:02

Use the ADIR() function to get an array with your .IDX file names. You can
than create a table with the appropriate structure and APPEND FROM ARRAY the
array into the table.

--
Fred
Microsoft Visual FoxPro MVP
 
 
 

show file in table

Post by YmlqYW » Wed, 24 Aug 2005 00:34:28

hi
it is working very good
thank you very much