--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: http://groups.google.com/group/harbour-users
Hi,
> I have now converted most of my FoxPro application into Harbour code.
> This is a list of the problems I had and how I solved them :
> Compile time errors
> 1. ; (line continuation chr) in text areas. Move semicolons out of
> text areas.
Can you show some code examples illustrating the problem?
> 2. Differences in array syntax. Dimension to private, round brackets
> to square.
> Example:
> dime arrayv(3,5) && FoxPro
> private arrayv[3,5] && Harbour
Seems that we can hide such difference using PP rules. We have hbfoxpro.ch
file where we can add them so later is enough to compile FP code using
-u+hbfoxpro.ch harbour compiler or hbmk2 switch:
=============================================================================
#xtranslate __FP_DIM( <exp> ) => <exp>
#xtranslate __FP_DIM( <!name!>( <dim,...> ) ) => <name>\[ <dim> \]
#command PUBLIC <var1> [, <varN> ] => ;
<@> PUBLIC __FP_DIM( <var1> ) [, __FP_DIM( <varN> ) ]
#command PRIVATE <var1> [, <varN> ] => ;
<@> PRIVATE __FP_DIM( <var1> ) [, __FP_DIM( <varN> ) ]
#command DIMENSIONS <!name1!>( <dim1,...> ) [, <!nameN!>( <dimN,...> ) ] => ;
PRIVATE <name1>\[ <dim1> \] [, <nameN>\[ <dimN> \] ]
=============================================================================
This rules should allow to use:
() instead of [] in array declarations, i.e.:
publ ar1( 100, 200 ), ar2( 200 )
publ v1, v2 := 100, ar3( 100, 200 ), ar4( 200 )
priv v3, ar5( 100, 200 ), v4, v5, ar6( 200 )
dime ar10( 100, 200 ), ar11( 200 )
Questions:
Does FP allows to use () as index operators to access array items?
Does FP has some other type of declaration (i.e. LOCAL) which also
can use () to define array dimensions?
> 3. recno(0) (Fox) vs set softseek on (Harbour).
Can you describe more precisely the difference?
> 4. 'Display' doesn't need the 'fields' clause.
This can be resolved by such PP rule:
#command DISPLAY [[FIELDS] <v,...>] [<off:OFF>] ;
[<prn:TO PRINTER>] [TO FILE <(f)>] ;
[FOR <for>] [WHILE <while>] [NEXT <next>] ;
[RECORD <rec>] [<rest:REST>] [<all:ALL>] => ;
__dbList( <.off.>, { <{v}> }, <.all.>, ;
<{for}>, <{while}>, <next>, ;
<rec>, <.rest.>, <.prn.>, <(f)> )
> 5. 'Browse' not supported, browse().
#command BROWSE => Browse()
but I guess BROWSE command in FP supports some additional clauses which
should be implemented too.
> 6. Scroll() function not supported.
???
Scroll() is standard Clipper and Harbour function. It's fully supported.
What does not work for you?
> 7. Errors in the form " undefined reference to `HB_FUN_TREATV'" mean
> that Harbour cannot find a udf named treatv(). Typically this will be
> because a FoxPro array variable hasn't been reformatted. So, for
> instance a line still has
> treatv(blah, blah), rather than treatv[blah, blah]. Also the FoxPro
> sys() functions will all trigger this (HB_FUN_SYS).
So I guess that FP also allows to access array items using () as
array index operator. Am I right or it was only from declaration?
> 8. Sys(2) = seconds(). Seconds() return numeric, sys(2) returns
> character, so val(sys(2)) = seconds().
> 9. Sys(2002) = set cursor off.
> 10. Sys(2002,1) = set cursor on.
Viktor already created SYS() function in hbfoxpro library with
such few entries but FP users should add other ones which exist
in FP.
> 2. Memory variable (.mem) files aren't compatible, they have to be
> recreated.
Probably we can add some simple converted though I do not think it's
critical problem.
> I hope this may help anyone who follows the same FoxPro to Harbour
> path. If anyone notices something I missed feel free to reply. Thanks
> especially to Massimo.
If FP users participate in adding PP rules to hbfoxpro.ch, adding
missing functions to hbfoxpro library and extending existing one
then we can probably address most of FP features and syntax.
I do not know FP so I cannot help here but I can help to resolve
clearly defined problems.
best regards,
Przemek
Hi,
> Now that my code is running in Harbour what concerns me most is the
> possibility of table (.dbf) corruption, as my tables are all as
> created in FoxPro Unix. I'm running FreeBSD 7.2 and the ported version
> of Harbour is 1.0.1 Intl. (Rev. 9429). Does anyone have any experience
> with FoxPro tables (.dbf) when modified by version 1.0.1? Is there a
> recommendation to always convert to Harbour created tables?
I strongly suggest to use newer Harbour version.
You can rebuild Harbour SVN code in FreeBSD very simple.
BTW It would be nice if some FreeBSD user can update this old
Harbour port.
Please send some FP DBF examples here so I can check their headers.
best regards,
Przemek
Hi,
> As we can't upload to the files section any more I've put the file
It's standard DBASEIII file which can be used by Harbour and Clipper
without any problems.
best regards,
Przemek