[Harbour-users] Re: Re: function for update dbf structure
Richard
eyelagui at adinet.com.uy
Fri Dec 18 10:39:14 EST 2009
OK... now... you can write every one of the routines to make every one
of the steps needed.
As you can think on the way to make every check, you can write a routine
that do it every check.
As you can think on the way to make every change, you can write a
routine that do every change.
So... is not that hard and once you have it writen you can:
a) Keep it and use it on every program you like
b) Share it with the world.
The opensource planet is not only to go and ask, is also to go and give
but the most important thing is that you can go and think by yourself.
I can´t call me a programmer if i'm not minded to write at least 1
routine by myself.
If i don't do it, i'm only a puzzle assembler, where i'm always asking
others for pieces to complete my own endless puzzle.
I'm sorry if this makes anyone bother or get angry, but is what i'm seing.
You can't just go and ask for everything you "don't want/like to do".
You can ask for something you don't know or you don't figure... but if
you know and/or you can figure, you can do it.
Come on people, bring back to life the real programmers or go sell hot dogs.
The "thing" you are asking is that someone else writes what you need
because you dont want to do it, and it will end by having a .prg writen
by someone just because someone else didn't want to do it and asked for it.
And i say a .prg because you can do that with 100% dbase code.... yes,
dbase, not even 1 "new" function is needed.
Lucas De Beltrán escribió:
> 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 <alcisoft at arrakis.es>
>
>
>> 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 at mail.gmail.com>...
>> 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
>> <alcisoft at arrakis.es>:
>>
>>> 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
>>>
>> <4B2A323C.5040409 at adinet.com.uy>...
>>
>>> 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 <szekely3 at enternet.hu>
>>>>
>>>>
>>>>
>>>>> 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)
>>>>>> Harbour-users at harbour-project.org
>>>>>> http://lists.harbour-project.org/mailman/listinfo/harbour-users
>>>>>>
>>>>>>
>>>>>>
>>>>> ________________________________________________
>>>>> Szekely Andras <> szekely3 at enternet.hu <>
>>>>>
>>> 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)
>>>>> Harbour-users at harbour-project.org
>>>>> http://lists.harbour-project.org/mailman/listinfo/harbour-users
>>>>>
>>>>>
>>>>>
>>>> _______________________________________________
>>>> Harbour-users mailing list (attachment size limit: 40KB)
>>>> Harbour-users at harbour-project.org
>>>> http://lists.harbour-project.org/mailman/listinfo/harbour-users
>>>>
>>>>
>>>>
>>>
>>> _______________________________________________
>>> Harbour-users mailing list (attachment size limit: 40KB)
>>> Harbour-users at harbour-project.org
>>> http://lists.harbour-project.org/mailman/listinfo/harbour-users
>>>
>>>
>>
>> --
>> Massimo Belgrano
>>
>>
>>
>> _______________________________________________
>> Harbour-users mailing list (attachment size limit: 40KB)
>> Harbour-users at harbour-project.org
>> http://lists.harbour-project.org/mailman/listinfo/harbour-users
>>
>>
> _______________________________________________
> Harbour-users mailing list (attachment size limit: 40KB)
> Harbour-users at harbour-project.org
> http://lists.harbour-project.org/mailman/listinfo/harbour-users
>
>
More information about the Harbour-users
mailing list