Lucas, On light thinking:
dbModStruct(cFile, aNewStruct) 1st. SET DELETED OFF (For APPEND FROM) 2st. cFile not in use 3rd. Renamed (.dbf and .ftp (or .dbt) files) 4th. disk space available... minor question 5th. init value on old records existing 6th. during operation if error then renamed to original names (BEGIN SEQUENCE) 7th ... thinking..... Regards Lucas De Beltrán escribió en mensaje ... I agree. It is a very complex fuction. First of all, the function should compare the exsisting structure with the new one and peform the changes. Next point, is data width checking. Last point, inherint existing data and adapting them to the new structure. We need a helping hand from the gurus!!!. best regards, 2009/12/18 Antonio Martinez <[email protected]> > Massimo > Imagine it: > > Scenario: Temp.Dbf Struct is {{"NField", "N", 10, 0} } and 1000 records > > > FUNCTION Main > Local aNewStruct:= {{"NField", "N", 3, 0}} > > > // This generates run time error data width error > dbModStruct("Temp.Dbf", aNewStruct) > > RETURN NIL > > > > > Massimo Belgrano escribió en mensaje > <609353e70912171005qfc28389j7b013bd8151a8afa-jsoawuisxosn+bqq9rb...@public.g mane.org>... > dbcreate(D_APP,ADBF) // Create nes dbf with new structure > use > use &(D_APP) alias APPOGGIO && open it > append from &(D_FDBF) // append data > use > Now rename > > 2009/12/17 Antonio Martinez > <[email protected]>: > > Hi, > > > > You must write it dbmodify thinking on errors protection; > > For example: Data width error, corruption detected, etc.... > > > > Too possibillity to write init values for old records, etc... > > Too renamed memo file .fpt (or .dbt) associated > > > > Really its a complex function ! > > > > Function is dbModStruct(cFile, aNewStruct) > > > > Regards > > > > > > > > > > Richard escribió en mensaje > <[email protected]>... > > You can develop the new function by programming the necessary steps. > > > > > > Lucas De Beltrán escribió: > >> Hi, > >> > >> Thanks, but it will be more powerful a funcion dbmodify( newstruct ). > >> > >> regards, > >> > >> 2009/12/16 szekely <[email protected]> > >> > >> > >>> Hi ! > >>> > >>> DBCREATE() ? > >>> > >>> Not too simple: you make a new table, from the old table copy the > >>> records into the new, and after rename it to the old name. > >>> > >>> Andras > >>> > >>> On Wed, 16 Dec 2009 09:01:07 +0100, Lucas De Beltrán wrote: > >>> > >>> > >>>> Hi, > >>>> > >>>> Is there a function in Harbour that updates a DBF structure?. For > > example, > >>>> updatedbf( dbffile, newstructure ). > >>>> > >>>> Thanks!! > >>>> _______________________________________________ > >>>> Harbour-users mailing list (attachment size limit: 40KB) > >>>> [email protected] > >>>> http://lists.harbour-project.org/mailman/listinfo/harbour-users > >>>> > >>>> > >>> ________________________________________________ > >>> Szekely Andras <> [email protected] <> > > eCS 1.2 <> > >>> http://www.scharenkreutzer.hu <> > > http://2Mai.dyndns.org <http://2mai.dyndns.org/><http://2mai.dyndns.org/ > > > >>> > >>> _______________________________________________ > >>> Harbour-users mailing list (attachment size limit: 40KB) > >>> [email protected] > >>> http://lists.harbour-project.org/mailman/listinfo/harbour-users > >>> > >>> > >> _______________________________________________ > >> Harbour-users mailing list (attachment size limit: 40KB) > >> [email protected] > >> http://lists.harbour-project.org/mailman/listinfo/harbour-users > >> > >> > > > > > > > > _______________________________________________ > > Harbour-users mailing list (attachment size limit: 40KB) > > [email protected] > > http://lists.harbour-project.org/mailman/listinfo/harbour-users > > > > > > -- > Massimo Belgrano > > > > _______________________________________________ > Harbour-users mailing list (attachment size limit: 40KB) > [email protected] > http://lists.harbour-project.org/mailman/listinfo/harbour-users > _______________________________________________ Harbour-users mailing list (attachment size limit: 40KB) [email protected] http://lists.harbour-project.org/mailman/listinfo/harbour-users
