Re: Xbase++ to harbour / HMG Question
Posted: Sun Sep 01, 2019 10:19 pm
You a wrongly asuming Harbour uses only 1 core on Mt.
Exclusive forum for HMG, a Free / Open Source xBase WIN32/64 Bits / GUI Development System
http://mail.hmgforum.com/
i recognize it when work with harbour / HMG and mt=yes that not only 1 Core is work like in Xbase++
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 ?
---Main O
connect to 'localhost' Port: 5432 DB: mdidemo User postgres
CreatePGTable U
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
...
Retrieve one or more substrings from the memory buffer pointed by <pMem> starting at position <nShift>.
Syntax:
Parameters:Code: Select all
PeekStr(<pMem>,[[@]<nShift>],<nSize>) -> <cStr> PeekStr(<pMem>,[[@]<nShift>],-1) -> <cStr> PeekStr(<pMem>,[[@]<nShift>],@<cStr>) -> <nSize> PeekStr(<pMem>,[[@]<nShift>],[@]<aSizes>) -> <aStr>
<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.
here Solution it detect if DLL / EXE is for 32 Bit or 64 Bit