>I have gone brain dead. Its only taken 55 years. I have created a table of the structure of another table. I have appended a few fields to the structure table. Now I want to create a new table with the entire new structure. I can't remember the statement syntax to do it.
>
>Any help will be greatly appreciated.
select myOriginalTable
local aStru(1)
=afields(aStru)
create cursor mytemp from array aStru
alter table alias() add column...
.
.
copy to myFreeTable
select mytemp
use
Problem here could be long fields names if you use them, otherwise works for me.
If table is part of database with triggerrs and all that then folowing function might be usefull;
Function below will fill up an empty array already created / passed as parameter
with 'fat-free' table fields structure (4 out of 16 columns) convinient for creating tmp cursors
As original Afields it also returns back number of fields
function afields4
lparameters lArray
local lArrStru(1) , i , j
declare lArray(afields(lArrStru), 4 )
for i=1 to alen(lArrStru,1)
for j = 1 to 4
lArray(i,j) = lArrStru(i,j)
next
next
return alen(lArray,1)
HTH