Page 2 of 4

Re: Editsource() Problem

PostPosted: Mon Jun 08, 2020 4:38 pm
by nageswaragunupudi
Thanks. I am able to build the exe now.
Yes, there is a problem.
How this linking affects the logic inside the fwh lib is puzzling.
Let me see.

Re: Editsource() Problem

PostPosted: Mon Jun 08, 2020 6:29 pm
by ricbarraes
Ok, thank you!

Let us know if you need help or anything :D

Re: Editsource() Problem

PostPosted: Mon Jun 08, 2020 6:37 pm
by nageswaragunupudi
Please build this small program with buildh.bat and hbmk2 and see the difference.

Code: Select all  Expand view
#include "fivewin.ch"

function Main()

   local oCn, oRs
   local cSql, nAt := 0

   cSql  := "SELECT * FROM states AS st ORDER BY code LIMIT 5"
   HB_AtX( " ORDER BY | HAVING | LIMIT | GROUP ", cSql, .f., @nAt )
   ? nAt, cSql, SubStr( cSql, nAt )

 
return nil
 


In our library, we are depending on HB_AtX(...).
This Harbour function is returning different values with buildh.bat and hbmk2.
Please test and confirm.

Re: Editsource() Problem

PostPosted: Mon Jun 08, 2020 6:47 pm
by ricbarraes
Ok, we are testing it right now, just a moment

Re: Editsource() Problem

PostPosted: Mon Jun 08, 2020 6:49 pm
by vilian
Yes, you are right. The exe generated with HBMK2 is returning 0(Zero) to nAt.

Re: Editsource() Problem

PostPosted: Mon Jun 08, 2020 6:57 pm
by nageswaragunupudi
We request the hbmk2 experts to please see the hbp script and advise corrections to resolve this issue.

Re: Editsource() Problem

PostPosted: Mon Jun 08, 2020 7:00 pm
by vilian
Do you know where is HB_AtX() function ? which .lib ?

Re: Editsource() Problem

PostPosted: Mon Jun 08, 2020 7:45 pm
by cnavarro

Re: Editsource() Problem

PostPosted: Mon Jun 08, 2020 7:53 pm
by vilian
Thank you,
It's a really nice page!

Re: Editsource() Problem

PostPosted: Mon Jun 08, 2020 8:10 pm
by ricbarraes
thank you, it helped us to track the function.

but it seems to be inside some core Harbour library:

# Function Library
935) hb_AtX harbour

so we don't know for sure how to access this lib, or even if it's accessible for us.

Could help us finding it?

cnavarro wrote:http://www.elektrosoft.it/tutorials/Harbour-Reference-Guide/harbour-complete-functions-list.htm

Re: Editsource() Problem

PostPosted: Tue Jun 09, 2020 1:35 am
by nageswaragunupudi
HB_AtX() is in hbrtl.lib.

HB_AtX() function is a regex function. While building with hbmk2 using the above script, some dummy function is being linked instead of the correct function.

It is possible to replace HB_AtX() in this particular case with a suitable FWH function like AAT() or FW_AT().

But we still do not know what other functions, particularly regex functions our FWH library will fail resulting in wrong behaviour. And you will all be complaining that it is a problem with our FWH library.

We can prove the functionality with buildh.bat.

I do not know hbmk2. You need to first consult experts and come out with a reliable hbp script. Till then, it is difficult for me to provide support if the application is built with hbmk2.

The caption "EditSource() problem" is misleading. There is no problem at all with EditSource. Please consider changing the title.

Re: Editsource() Problem

PostPosted: Tue Jun 09, 2020 2:09 am
by ricbarraes
Ok, I'll ask Vilian to change the title for a more specific now that everything is well understood.

Thank you guys for the support, we'll try to change that function but we are kinda concerned about the rest of our code

we didn't even know that hbmk2 has no relation to fivewin, in fact we thought it was an update over buildh...

Do you know anyone with more ackowledge about the hbmk2 that could help us with our hbp?

we are frequently visiting this website to get information about the hbmk2, but we couldn't recognize any parameter related to this issue

https://github.com/harbour/core/blob/master/utils/hbmk2/doc/hbmk2.en.md

let's wait for some hbmk2 expert to show up...

thank you again

Re: Editsource() Problem

PostPosted: Tue Jun 09, 2020 3:11 am
by nageswaragunupudi
Another sample.
Try with both buildh.bat and hbmk2.exe and see the difference.
Code: Select all  Expand view
#include "fivewin.ch"

function Main()

   local cSql, aMatch

   cSql  := "SELECT * FROM customer WHERE AGE BETWEEN 50 AND 60 OR STATE = 'NY'"
   aMatch := hb_regex( "[a-z|0-9|_`]* between .* and ['|a-z|0-9|&|?|:]*", cSql, .f. )
   if aMatch == nil
      ? "function returned nil. It should return array"
   elseif Empty( aMatch )
      ? "function returns empty array"
   else
      ? "result:", aMatch[ 1 ]
   endif

return nil
 


This being the case it is not safe for you to build your release software with hbmk2 till you get expert guidance.

Re: Editsource() Problem

PostPosted: Tue Jun 09, 2020 5:25 am
by Antonio Linares
Please try to remove hbwin and -mt from the hbp file and let us know what you get

Re: Editsource() Problem

PostPosted: Tue Jun 09, 2020 7:23 am
by nageswaragunupudi
1. removing -mt made no difference.

2. removing -hbwin resulted in unresolved errors.

Code: Select all  Expand view
hbmk2: Error: Referenced, missing, but unknown function(s): WIN_OLEERRORTEXT(),
       WIN_OLEAUTO(), __OLEINVOKEMETHOD(), __OLEINVOKEPUT(), __OLEINVOKEGET(),
       WIN_OLEERROR(), __OLEISDISP(), __OLECREATEOBJECT(), WIN_P2N(),
       __OLEGETACTIVEOBJECT(), WAPI_MESSAGEBOX(), __OLEVARIANTNEW(),
       WIN_OSVERSIONINFO(), WIN_OSISNT(), WIN_OSISNT351(), WIN_OSISNT4(),
       WIN_OSIS2000ORUPPER(), WIN_OSIS2000(), WIN_OSISXP(),
       WIN_OSISWINXPORUPPER(), WIN_OSIS2003(), WIN_OSISVISTA(),
       WIN_OSISVISTAORUPPER(), WIN_OSIS7(), WIN_OSIS8(), WIN_OSIS9X(),
       WIN_OSIS95(), WIN_OSIS98(), WIN_OSISME(), WIN_OSISTSCLIENT(),
       WIN_OSNETREGOK(), WIN_OSNETVREDIROK(), WIN_ANSITOWIDE(),
       WIN_WIDETOANSI(), WIN_AXINIT(), WAPI_CREATEWINDOWEX(),
       WIN_AXGETCONTROL(), WAPI_OUTPUTDEBUGSTRING()