STRU - Lists and modifies the structure of the dbfs files
Moderator: Rathinagiri
- Pablo César
- Posts: 4059
- Joined: Wed Sep 08, 2010 1:18 pm
- Location: Curitiba - Brasil
STRU - Lists and modifies the structure of the dbfs files
Hi amigo Esgici !
Your example is very interesting uses of DBINFO. Thank you for your contrib.
I was thinking before I was making adjustings to determine which can of DBF file is: Clipper or FoxPro format (DBT or FPT). And I found another good example of Mr. Grigory Filatov in C:\MiniGUI\SAMPLES\Advanced\dbfHeaderInfo\demo.prg
But I did not implemented, because I thought it is enough to know if dbf contains DBT or FPT extension file. But I also understand that is not the right way to know.
I make some little changes in your code and I adapted Grigory example for other option. The interesting, all of these bringing us a good chance to implement with very good ideas. Which I am very greatfully, Mr Esgici ! So I am attaching both exemples here for testing, one is using opening dbf to obtain results, other example is not necessary to open with command USE or DBUSEAREA which is also interesting (open file in low level, yes).
Thank you again Mr. Esgici for your special good attention.
Your example is very interesting uses of DBINFO. Thank you for your contrib.
I was thinking before I was making adjustings to determine which can of DBF file is: Clipper or FoxPro format (DBT or FPT). And I found another good example of Mr. Grigory Filatov in C:\MiniGUI\SAMPLES\Advanced\dbfHeaderInfo\demo.prg
But I did not implemented, because I thought it is enough to know if dbf contains DBT or FPT extension file. But I also understand that is not the right way to know.
I make some little changes in your code and I adapted Grigory example for other option. The interesting, all of these bringing us a good chance to implement with very good ideas. Which I am very greatfully, Mr Esgici ! So I am attaching both exemples here for testing, one is using opening dbf to obtain results, other example is not necessary to open with command USE or DBUSEAREA which is also interesting (open file in low level, yes).
Thank you again Mr. Esgici for your special good attention.
- Attachments
-
- Memos.rar
- (1.22 MiB) Downloaded 267 times
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
- esgici
- Posts: 4543
- Joined: Wed Jul 30, 2008 9:17 pm
- DBs Used: DBF
- Location: iskenderun / Turkiye
- Contact:
Re: STRU - Lists and modifies the structure of the dbfs file
Ola Amigo Pablo
Thanks to double demo and your nice words, I'm honoured
Once upon a time my teacher said me : "prefer high level whenever possible ! ..."
Please don't compare me with gurus, I'm only a student
In other hand, the "identification code" code of table ( very first byte of every table ) has many more variations:
Saludos
Thanks to double demo and your nice words, I'm honoured

Once upon a time my teacher said me : "prefer high level whenever possible ! ..."

Please don't compare me with gurus, I'm only a student

In other hand, the "identification code" code of table ( very first byte of every table ) has many more variations:
As easily seen, there are more codes meaning "FPT" other than 0xF5.0x02 : 2 : FoxBASE
0x03 : 3 : FoxBASE+ or dBASE III+, no memo
0x30 : 48 : Visual FoxPro
0x31 : 49 : Visual FoxPro, autoincrement enabled
0x43 : 67 : dBASE IV SQL, no memo
0x54 : 84 : dBASE IV SQL table, with memo
0x63 : 99 : dBASE IV SQL system, no memo
0x83 : 131 : FoxBASE+ or dBASE III+, with memo
0x8B : 139 : dBASE IV with memo
0xA7 : 167 : FoxPro 2.x (or older), with memo
0xB9 : 185 : FoxBASE ( memo ? )
0xCB : 203 : dBASE IV SQL table files, with memo
0xE2 : 226 : FoxBASE+ or dBASE III+, with memo
0xEF : 239 : dBASE IV with memo
0xF5 : 245 : FoxPro 2.x (or earlier) with memo
0xFB : 251 : FoxBASE
Did you meant something like this ?Pablo César wrote: open file in low level ...
Saludos
Viva INTERNATIONAL HMG 

- Pablo César
- Posts: 4059
- Joined: Wed Sep 08, 2010 1:18 pm
- Location: Curitiba - Brasil
STRU - Lists and modifies the structure of the dbfs file
Yeah ! I fully agree !esgici wrote:Once upon a time my teacher said me : "prefer high level whenever possible ! ..."
I have seen this table before, thanks for mentioning.In other hand, the "identification code" code of table ( very first byte of every table ) has many more variations:
0x02 : 2 : FoxBASE
0x03 : 3 : FoxBASE+ or dBASE III+, no memo
0x30 : 48 : Visual FoxPro
0x31 : 49 : Visual FoxPro, autoincrement enabled
0x43 : 67 : dBASE IV SQL, no memo
0x54 : 84 : dBASE IV SQL table, with memo
0x63 : 99 : dBASE IV SQL system, no memo
0x83 : 131 : FoxBASE+ or dBASE III+, with memo
0x8B : 139 : dBASE IV with memo
0xA7 : 167 : FoxPro 2.x (or older), with memo
0xB9 : 185 : FoxBASE ( memo ? )
0xCB : 203 : dBASE IV SQL table files, with memo
0xE2 : 226 : FoxBASE+ or dBASE III+, with memo
0xEF : 239 : dBASE IV with memo
0xF5 : 245 : FoxPro 2.x (or earlier) with memo
0xFB : 251 : FoxBASE
Well seems it is longer matter than we think. In this case, I do not have inttentions to create a table types of rdds. I believe that only by it extension name, will be enough.As easily seen, there are more codes meaning "FPT" other than 0xF5.
Wow Mr. Esgici, this is also very good job. I liked much "Record Data" tab. Very prolixed job, congrats !!Did you meant something like this ?Pablo César wrote: open file in low level ...
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
- esgici
- Posts: 4543
- Joined: Wed Jul 30, 2008 9:17 pm
- DBs Used: DBF
- Location: iskenderun / Turkiye
- Contact:
Re: STRU - Lists and modifies the structure of the dbfs file
Obrigado Pablo 
Saludos

Sorry, what is meaning of prolixedPablo César wrote: ... Very prolixed job, congrats !!

Saludos
Viva INTERNATIONAL HMG 

- danielmaximiliano
- Posts: 2625
- Joined: Fri Apr 09, 2010 4:53 pm
- Location: Argentina
- Contact:
Re: STRU - Lists and modifies the structure of the dbfs file
Hi Esgici :esgici wrote:Obrigado Pablo
Sorry, what is meaning of prolixedPablo César wrote: ... Very prolixed job, congrats !!![]()
Saludos
Look : http://translate.google.com/#es/en/prolijo
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*
Saludos / Regards
DaNiElMaXiMiLiAnO
Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*
Saludos / Regards
DaNiElMaXiMiLiAnO
Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
- Pablo César
- Posts: 4059
- Joined: Wed Sep 08, 2010 1:18 pm
- Location: Curitiba - Brasil
STRU - Lists and modifies the structure of the dbfs files
Sorry. I´ve tried to say with this meaning: A capricious notion, fancy, brillant.esgici wrote:Sorry, what is meaning of prolixedPablo César wrote: ... Very prolixed job, congrats !!
Finally in English version ! Release version 3.5.
Two files .Lng have been attached (Portuguese and English). Translations must be done to local language according English.lng file and should be following the same sequence, line by line.
Whom wish to colaborate with attaching local language file already translated, would it be much appreciated your contribution.
<Attached file removed, see last message with now release>
Last edited by Pablo César on Thu Aug 30, 2012 8:48 pm, edited 1 time in total.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
- esgici
- Posts: 4543
- Joined: Wed Jul 30, 2008 9:17 pm
- DBs Used: DBF
- Location: iskenderun / Turkiye
- Contact:
Re: STRU - Lists and modifies the structure of the dbfs file
Ola Pablo


I hope that I will understand finally meaning of "processos"
Regarding translation; definitely I will translate it to my language and will post to you
Happy HMG'ing
Please don't care; I know you don't use any bad word about mePablo César wrote:prolixed, capricious, fancy, etc.

Thanks a lotPablo César wrote:Finally in English version ! Release version 3.5.

I hope that I will understand finally meaning of "processos"

Regarding translation; definitely I will translate it to my language and will post to you

Happy HMG'ing

Viva INTERNATIONAL HMG 

- Pablo César
- Posts: 4059
- Joined: Wed Sep 08, 2010 1:18 pm
- Location: Curitiba - Brasil
STRU - Lists and modifies the structure of the dbfs file
Ohh no, never.esgici wrote:Please don't care; I know you don't use any bad word about mePablo César wrote:prolixed, capricious, fancy, etc.
Ohhh yeah, it will be usefull for others. Thanks in advanced.Regarding translation; definitely I will translate it to my language and will post to you
Made another small implementing but great in its sense ! My mention of "My thanks to: "+Contributors_friends() at Read me StatusBar item

Thank all for tips !
<Attached file removed, see last message with now release>
Last edited by Pablo César on Fri Aug 31, 2012 1:41 am, edited 2 times in total.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
- esgici
- Posts: 4543
- Joined: Wed Jul 30, 2008 9:17 pm
- DBs Used: DBF
- Location: iskenderun / Turkiye
- Contact:
Re: STRU - Lists and modifies the structure of the dbfs file
Hi Pablo
Thank to your thanks to me on Read Me page; I'm honored
I understood why I don't understood
You are using too many functions that I don't heard yet
Such as :
and others ...
Please inform me the source of this unknown, undocumented, mysterious things and their usages
By the way, we have a little problem :
Error BASE/1003 Variable does not exist: HB_GTI_CLIPBOARDDATA
Called from SELESAIDA(338)
Probably, you have made a global find and replace for "HB_" -> "Hb_"
sadly manifest constants are case sensitive
In other hand, IMHO we don't need tricky low level functions for hex <-> dec conversions;
NTOC( nX, 16 ) is usable to convert for any numeric to hex and CTON( cX, 16 ) any hex string to numeric.
TIA
Hi All
This is my 2000 nth post
Everything is for community;
Viva HMG !
Thank to your thanks to me on Read Me page; I'm honored


I understood why I don't understood

You are using too many functions that I don't heard yet

Such as :
Code: Select all
Hb_CompileFromBuf()
Hb_HrbDo()
Hb_HrbLoad()
Please inform me the source of this unknown, undocumented, mysterious things and their usages

By the way, we have a little problem :
Error BASE/1003 Variable does not exist: HB_GTI_CLIPBOARDDATA
Called from SELESAIDA(338)
Probably, you have made a global find and replace for "HB_" -> "Hb_"

sadly manifest constants are case sensitive

In other hand, IMHO we don't need tricky low level functions for hex <-> dec conversions;
NTOC( nX, 16 ) is usable to convert for any numeric to hex and CTON( cX, 16 ) any hex string to numeric.
TIA
Hi All
This is my 2000 nth post

Everything is for community;
Viva HMG !
Viva INTERNATIONAL HMG 

- Pablo César
- Posts: 4059
- Joined: Wed Sep 08, 2010 1:18 pm
- Location: Curitiba - Brasil
STRU - Lists and modifies the structure of the dbfs file
These internal functions of Harbour is not new, itg is from ChangeLog 9545 2008-10-04 19:23:36Z druzus. And these are documented (one of my recommended site for Harbour searching is: http://www.harbour.vouch.info/index.html) and it is from Virtual Memory API, please see in c:\harbour\source\vm and c:\harbour\source\compiler you will find files: runner.c and hbcmplib.c having following functions:esgici wrote:You are using too many functions that I don't heard yet![]()
Such as :
and others ...Code: Select all
Hb_CompileFromBuf() Hb_HrbDo() Hb_HrbLoad()
Please inform me the source of this unknown, undocumented, mysterious things and their usages
Code: Select all
HB_COMPILEFROMBUF(void)
HB_FUNC( HB_COMPILEFROMBUF )
{
int iResult, argc;
char ** argv, * szSource;
BYTE * pBuffer;
ULONG ulLen;
szSource = hb_parc( 1 );
if( szSource )
{
hb_compGenArgList( 2, hb_pcount(), &argc, &argv );
iResult = hb_compMain( argc, argv, &pBuffer, &ulLen, szSource );
hb_xfree( argv );
if( iResult == EXIT_SUCCESS && pBuffer )
hb_retclen_buffer( ( char * ) pBuffer, ulLen );
}
}
Code: Select all
HB_HRBDO(void)
HB_FUNC( HB_HRBDO )
{
PHRB_BODY pHrbBody = hb_hrbParam( 1 );
if( pHrbBody )
{
int iPCount = hb_pcount() - 1;
PHB_ITEM * pParams = NULL;
int i;
if( iPCount > 0 )
{
pParams = ( PHB_ITEM * ) hb_xgrab( sizeof( PHB_ITEM ) * iPCount );
for( i = 0; i < iPCount; i++ )
pParams[ i ] = hb_stackItemFromBase( i + 2 );
}
hb_hrbDo( pHrbBody, iPCount, pParams );
if( pParams )
hb_xfree( pParams );
}
else
hb_errRT_BASE( EG_ARG, 6104, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
}
Code: Select all
HB_HRBLOAD(void)
HB_FUNC( HB_HRBLOAD )
{
ULONG ulLen = hb_parclen( 1 );
if( ulLen > 0 )
{
char * fileOrBody = hb_parc( 1 );
PHRB_BODY pHrbBody;
if( ulLen > 4 && memcmp( szHead, fileOrBody, 4 ) == 0 )
pHrbBody = hb_hrbLoad( fileOrBody, ulLen );
else
pHrbBody = hb_hrbLoadFromFile( fileOrBody );
if( pHrbBody )
{
int iPCount = hb_pcount() - 1;
PHB_ITEM * pParams = NULL;
int i;
if( iPCount > 0 )
{
pParams = ( PHB_ITEM * ) hb_xgrab( sizeof( PHB_ITEM ) * iPCount );
for( i = 0; i < iPCount; i++ )
pParams[ i ] = hb_stackItemFromBase( i + 2 );
}
hb_hrbInit( pHrbBody, iPCount, pParams );
if( pParams )
hb_xfree( pParams );
}
hb_hrbReturn( pHrbBody );
}
else
hb_errRT_BASE( EG_ARG, 9998, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
}
You are right, I´ve corrected this problem.By the way, we have a little problem :
Error BASE/1003 Variable does not exist: HB_GTI_CLIPBOARDDATA
Called from SELESAIDA(338)
Probably, you have made a global find and replace for "HB_" -> "Hb_"
sadly manifest constants are case sensitive
Yes also right, I will need to optimize some functions.In other hand, IMHO we don't need tricky low level functions for hex <-> dec conversions;
NTOC( nX, 16 ) is usable to convert for any numeric to hex and CTON( cX, 16 ) any hex string to numeric.
Congratulations !This is my 2000 nth post![]()
<Attached file removed, see last message with now release>
Last edited by Pablo César on Mon Sep 03, 2012 6:36 pm, edited 2 times in total.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein