Page 2 of 2

Re: Xbase++ to harbour / HMG Question

Posted: Sun Sep 01, 2019 10:19 pm
by apais
You a wrongly asuming Harbour uses only 1 core on Mt.

Re: Xbase++ to harbour / HMG Question

Posted: Sun Sep 01, 2019 11:05 pm
by AUGE_OHR
apais wrote: Sun Sep 01, 2019 10:19 pm You a wrongly asuming Harbour uses only 1 core on Mt.
i recognize it when work with harbour / HMG and mt=yes that not only 1 Core is work like in Xbase++ :o
is mt=yes "safe" ?

---

under Xbase++ every Thread use same CPU Core and have a own Workspace. how about harbour / HMG :?:

Re: Xbase++ to harbour / HMG Question

Posted: Tue Sep 03, 2019 2:04 pm
by apais
Harbour manages it by iself. It also has it's own workspace.
I myself helped Przemek ( harbour core developper ) to do cross tests against xbase++ and it also went fine.

Re: Xbase++ to harbour / HMG Question

Posted: Tue Sep 03, 2019 2:06 pm
by apais
The only thing harbour doesn't have are sync methods (mutually exclusive among instances).

Re: Xbase++ to harbour / HMG Question

Posted: Tue Sep 03, 2019 9:05 pm
by AUGE_OHR
apais wrote: Tue Sep 03, 2019 2:04 pm Harbour manages it by iself. It also has it's own workspace.
Ah ... thx for Information
apais wrote:I myself helped Przemek ( harbour core developper ) to do cross tests against xbase++ and it also went fine.
so you are Xbase++ User ?

Re: Xbase++ to harbour / HMG Question

Posted: Wed Sep 04, 2019 3:35 pm
by apais
Yes I was.

Re: Xbase++ to harbour / HMG Question

Posted: Tue Sep 10, 2019 8:11 am
by AUGE_OHR
CLASS Object as Parameter :?:

hi,

i use own CLASS Object as Parameter but under harbour in Function CreatePGTable( oServer, ... ) VALTYPE() is NIL :o

Code: Select all

Function Main(...)
Local oServer
   oServer := PGSql():new()
   IF oServer:connect( cConnect )
      ? "Main ", VALTYPE(oServer)
      ? "connect to "+cServer+" Port: "+cPort+" DB: "+cDataBase+" User "+cUser
      CreatePGTable( oServer, ... )

FUNCTION CreatePGTable( oServer, ... )
   ? "CreatePGTable ", VALTYPE(oServer) // -> NIL ?
Result Output
Main O
connect to 'localhost' Port: 5432 DB: mdidemo User postgres
CreatePGTable U
---

now have use PRIVATE and not as Parameter and it work :!:
is this "by harbour Design" with CLASS Object :?: ... or is it my Xbase++ CLASS Style ... :roll:

Code: Select all

#include "hbclass.ch"

   oServer := PGSql():new()
   IF oServer:connect( cConnect )
      ...
      

CLASS PGSql
EXPORTED:
   VAR connID READONLY
   ...
   METHOD init
   METHOD connect
   ... 
ENDCLASS

METHOD PGSql:init()
   ::connID := 0
   ::lError := .F.
   ::cError := ""
   ::Schema := "public"
return self

METHOD PGSql:connect( cConnString )
   local lOk

   ::connID := PQconnectdb(cConnString)
   if !( lOk := (PQstatus(::connID) == 0) )
      ::connID := 0
   endif
return lOk
...

Re: Xbase++ to harbour / HMG Question

Posted: Wed Sep 11, 2019 4:10 am
by AUGE_OHR
hi,

i'm search for a Function like PeekStr() by ot4xb***

***LIB for Xbase++ by Pablo Botella Navarro https://www.xbwin.com/
Retrieve one or more substrings from the memory buffer pointed by <pMem> starting at position <nShift>.

Syntax:

Code: Select all

PeekStr(<pMem>,[[@]<nShift>],<nSize>) -> <cStr>
PeekStr(<pMem>,[[@]<nShift>],-1) -> <cStr>
PeekStr(<pMem>,[[@]<nShift>],@<cStr>) -> <nSize>
PeekStr(<pMem>,[[@]<nShift>],[@]<aSizes>) -> <aStr>
Parameters:

<pMem>
Base pointer to the memory buffer.

<nShift>
Zero based starting position within <pMem>. If this parameter is passed by reference will be increased with the number of bytes retrieved, to reuse it in subsequent calls of Peek...() functions.

<nSize>
Number of bytes to retrieve. If <nSize> == -1 a NULL terminated string is assumed and PeekStr() will retrieve the bytes up to the first NULL character.

Note: Using the -1 param with non NULL terminated string can result in a internal exception.

<cStr>
Character variable to fill with Len(<cStr>) bytes if provided by reference.

<aSizes>
Array with the number of bytes to retrieve per element. If an element of <aSizes> contains a character value will be take the size of the provided string element.

Re: Xbase++ to harbour / HMG Question

Posted: Thu Jul 09, 2020 1:41 am
by AUGE_OHR
AUGE_OHR wrote: Sun Sep 01, 2019 4:45 am what is used in harbour / HMG for
PeekWord(<pMem>,[[@]<nShift>]) -> <nWord>
PeekWord(<pMem>,[[@]<nShift>], <nItems>) -> <aWords>

Retrieve the value of one or more WORDs from the memory buffer pointed by <pMem> starting at the position <nShift>.
here Solution
HB_DLL6432.ZIP
(747 Bytes) Downloaded 184 times
it detect if DLL / EXE is for 32 Bit or 64 Bit