• Welcome to Powerbasic Museum 2020-B.
 

News:

Forum in repository mode. No new members allowed.

Main Menu

C++ willing to share

Started by Patrice Terrier, March 22, 2013, 03:46:26 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Patrice Terrier

If this could save a few head hache to some of you wanting to translate their PB code into C/C++, i am willing to share with you what i have learned so far.

I am thinking of the common basic functions/procedures we always need in most piece of software.

Here is a list of the generic i could share already at this time:

Export wstring UCASE$(IN wstring sBuf);
Export wstring LCASE$(IN wstring sBuf);
Export wstring LTRIM$(IN wstring sBuf, IN wstring sChar);
Export wstring RTRIM$(IN wstring sBuf, IN wstring sChar);
Export wstring TRIM$(IN wstring sBuf, IN wstring sChar);
Export wstring LEFT$(IN wstring sBuf, IN long nLeft);
Export wstring RIGHT$(IN wstring sBuf, IN long nRight);
Export wstring MID$(IN wstring sBuf, IN long nStart, IN long nMid);
Export wstring PARSE$(IN wstring sMain, IN wstring sDelim, IN long nIndex);
Export wstring NAMEX$(IN wstring sBuf);

Export wstring zDateTime();
Export wstring zGetTempPath();
Export wstring zExeName();

ExportC long INSTR(IN long fromPos, IN wstring sMain, IN wstring sSearch);
ExportC long longVAL(IN wstring sNum);
ExportC double floatVAL(IN wstring sNum);

ExportC long zFOpen(IN wstring sFilName, IN long AccessMode, IN long ShareMode, OUT HANDLE &hFile);
ExportC DWORD zFlof(IN HANDLE hFile);
ExportC long zFGet(IN HANDLE hFile, OUT string &sBuffer);
ExportC void zFClose(OUT HANDLE &hFile);

...

Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

John Spikowski

Have you thought of extending your ZapSolution.com site with a blog about your project?

It might be a good way to get your PB2C++ project off the ground.

James Fuller would be a good resource to have participate.


Patrice Terrier

#2
My project is already off the ground. I would never have  been able to do it, without the help of the Visual Studio editor, great piece of software i must say. And cherry on the cake i can produce the same source code for both 32/64-bit.
I still have problems with some of the obscur C/C++ syntax, but doing all the translation by hand is the best way for me to learn from my mistake.

I have already completed 50% of the whole project and the more i do, the faster i progress, because i can reuse what i have already learned.

...
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com