Xbase++ to harbour / HMG Question

Discuss anything else that does not suite other forums.

Moderator: Rathinagiri

User avatar
apais
Posts: 317
Joined: Fri Aug 01, 2008 6:03 pm
Location: uruguay
Has thanked: 52 times
Been thanked: 32 times
Contact:

Re: Xbase++ to harbour / HMG Question

Post by apais » Sun Sep 01, 2019 10:19 pm

You a wrongly asuming Harbour uses only 1 core on Mt.

User avatar
AUGE_OHR
Posts: 199
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany
Has thanked: 20 times
Been thanked: 26 times

Post by AUGE_OHR » Sun Sep 01, 2019 11:05 pm

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 :?:

User avatar
apais
Posts: 317
Joined: Fri Aug 01, 2008 6:03 pm
Location: uruguay
Has thanked: 52 times
Been thanked: 32 times
Contact:

Post by apais » Tue Sep 03, 2019 2:04 pm

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.

User avatar
apais
Posts: 317
Joined: Fri Aug 01, 2008 6:03 pm
Location: uruguay
Has thanked: 52 times
Been thanked: 32 times
Contact:

Post by apais » Tue Sep 03, 2019 2:06 pm

The only thing harbour doesn't have are sync methods (mutually exclusive among instances).

User avatar
AUGE_OHR
Posts: 199
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany
Has thanked: 20 times
Been thanked: 26 times

Post by AUGE_OHR » Tue Sep 03, 2019 9:05 pm

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 ?

User avatar
apais
Posts: 317
Joined: Fri Aug 01, 2008 6:03 pm
Location: uruguay
Has thanked: 52 times
Been thanked: 32 times
Contact:

Post by apais » Wed Sep 04, 2019 3:35 pm

Yes I was.

User avatar
AUGE_OHR
Posts: 199
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany
Has thanked: 20 times
Been thanked: 26 times

Post by AUGE_OHR » Tue Sep 10, 2019 8:11 am

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
...

User avatar
AUGE_OHR
Posts: 199
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany
Has thanked: 20 times
Been thanked: 26 times

Post by AUGE_OHR » Wed Sep 11, 2019 4:10 am

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.

Post Reply