Page 1 of 1

Posted: Tue Nov 12, 2002 4:39 pm
by BackupUser
Restored from previous forum. Originally posted by Art Sentinel.

Hi folks,

I am in process of translating Delphi code into PureBasic code. I understand most of the concepts, but I must be making a silly mistake somewhere because my version does not work yet. :wink: If anyone understands both Delphi and PureBasic, and would be kind enough to lend me some help, I will be very grateful. Please contact me via email.

This involves a brand new surprise contribution I am preparing for everyone on this forum. Once I get it to work for me, you will have it too. This is going to open up a whole new world of powerful possibilities using PB! So get your imaginations and your code typing fingers ready.. Haha..

Take care.


- Art Sentinel
http://www.artsentinel.net

--------------

Top Ten Reasons Not To Procrastinate:


Coming Soon...

Posted: Tue Nov 12, 2002 4:59 pm
by BackupUser
Restored from previous forum. Originally posted by Franco.

[start :)]
Do you pack special Delphi/Kylix stuff in a DLL :)
[end :)]

Have a nice day...

Franco

Posted: Tue Nov 12, 2002 5:18 pm
by BackupUser
Restored from previous forum. Originally posted by Pupil.

You have to be carefull with the If statements in delphi, it's very easy to make an error there. I've tried to translate some code and it wasn't fun at all. After serveral hours/days of debugging PB code and crosschecking with delphi code i discovered that the delphi code i had was buggy :wink: On the positive side my app was 1/20 the size of the original app.
Delphi is not that hard to understand, my only prior experience with something similar was in a programing course in Borland turbo pascal some 8 years ago(haven't touched it since then). For some commands you might want to download some help files from delphi to be able to understand exactly what they do.

Posted: Thu Nov 14, 2002 3:48 pm
by BackupUser
Restored from previous forum. Originally posted by Art Sentinel.

Hi,

Haha.. No, Franco, not exactly. I would not dare after that boring and drawn-out previous topic. :wink: But your humor leaves me laughing..

Thanks Pupil! I will keep your words close in mind as I am translating this code. So far I am 90% done. If I was writting this with the intention of creating something that instantly crashes, I would be 100% done! -lol- Delphi to Purebasic conversion is a little tricky, but I won't let that stop me.

Take care.

- Art Sentinel
http://www.artsentinel.net

--------------

Top Ten Reasons Not To Procrastinate:


Coming Soon...

Posted: Fri Nov 15, 2002 1:00 am
by BackupUser
Restored from previous forum. Originally posted by TheBeck.

Post removed

Posted: Fri Nov 15, 2002 2:36 pm
by BackupUser
Restored from previous forum. Originally posted by wcardoso.

Hi. I'm a skilled Delphi programmer, but I'm considering to switch to PB for their cross platform abilities, their cost (very cheap); and their small size (both the compiler and the compiled results).
I know, Delphi is a powerfull tool; but watching this forum for a while I'd noted the PB power to acomplish any kind of applications and I think it's enough for me.
I'm planning to code an EDA tool (Electronic Design Application) to use in both Windows and Linux environments, and plan to code it in a new software distribution way.
:)

Posted: Fri Nov 15, 2002 4:38 pm
by BackupUser
Restored from previous forum. Originally posted by Franco.

@wcardoso
If you need help let me know, I use EDA/CAD tools for living.

Have a nice day...

Franco

Posted: Sun Nov 17, 2002 2:10 pm
by BackupUser
Restored from previous forum. Originally posted by wcardoso.

Franco:
Please send me a email to be in contact. My email [url]mailto:wcardoso@ipusa.com.uy[/url]
Thanks
:)

Posted: Mon Nov 18, 2002 2:50 pm
by BackupUser
Restored from previous forum. Originally posted by marlo.

Hi all. I need help on this intersting item about convert some code in Delphi to PB. If anyone can help me, THANKS!!!!
For example i need to translate to PB this Delphi code, if anyone can help me on part of this or all, really i need it to make a plugin for Neobook authoring tool:

CONST
ACTIONPARAM_NONE = 0;
ACTIONPARAM_ALPHA = 1;
ACTIONPARAM_ALPHASP = 2;
ACTIONPARAM_NUMERIC = 3;
ACTIONPARAM_MIXED = 4;
ACTIONPARAM_FILENAME = 5;
ACTIONPARAM_VARIABLE = 6;
ACTIONPARAM_DATAFILE = 7;
MaxActionParams = 10;

TYPE TAddActionProc = PROCEDURE( IDNum : INTEGER;
Name, Hint : PChar;
Params : ARRAY OF BYTE;
NumParams : BYTE );
TAddFileProc = PROCEDURE( FileName : PChar; AddFlag :BOOLEAN );
TVarGetProc = PROCEDURE( VarName : PChar; VAR Value : PChar );
TVarSetProc = PROCEDURE( VarName, Value : PChar );
TPlayActionProc = PROCEDURE( Action : PChar );
TInterfaceProc = FUNCTION( InterfaceID : INTEGER; VAR Data : PChar ) : BOOLEAN;

VAR nbGetVar : TVarGetProc;
nbSetVar : TVarSetProc;
nbPlayAction : TPlayActionProc;
nbInterface : TInterfaceProc;
nbAddFile : TAddFileProc;
nbAddAction : TAddActionProc;
nbWinHandle : HWND;

PROCEDURE FreeStr( VAR S : PChar );
BEGIN
IF S NIL THEN GlobalFree( HGLOBAL( S ) );
S := NIL;
END;

PROCEDURE SetStr( VAR Dest : PChar; CONST Source : STRING );
BEGIN
IF Dest NIL THEN GlobalFree( HGLOBAL( Dest ) );
Dest := Pointer( GlobalAlloc( GMEM_FIXED, Length( Source )+1 ) );
StrCopy( Dest, PChar( Source ) );
END;

FUNCTION nbEditAction( IDNum : INTEGER;
VAR Params : ARRAY OF PChar ) : BOOLEAN;
BEGIN
Result := FALSE;
CASE IDNum OF
END;
END;

FUNCTION nbExecAction( IDNum : INTEGER;
VAR Params : ARRAY OF PChar ) : BOOLEAN;
BEGIN
Result := FALSE;
CASE IDNum OF
END;
END;

PROCEDURE nbMessage( MsgCode, Reserved : INTEGER );
BEGIN
CASE MsgCode OF
1 : ;
2 : ;
3 : ;
4 : ;
5 : ;
6 : ;
7 : ;
8 : ;
END;

END;

PROCEDURE nbInitPlugIn( WinHandle : HWND; VAR PlugInTitle, PlugInPublisher, PlugInHint : PChar );
BEGIN
nbWinHandle := WinHandle;
SetStr( PlugInTitle, 'Sample Plug-In' );
SetStr( PlugInPublisher, 'John Doe' );
SetStr( PlugInHint, 'Use this plug-in to display a Windows message box' );
END;

PROCEDURE nbRegisterScriptProcessor( PlayActionProc : POINTER );
BEGIN
nbPlayAction := @TPlayActionProc( PlayActionProc );
END;

PROCEDURE nbRegisterInterfaceAccess( InterfaceProc : POINTER );
BEGIN

nbInterface := @TInterfaceProc( InterfaceProc );
END;

PROCEDURE nbRegisterPlugIn( AddActionProc, AddFileProc, VarGetFunc, VarSetFunc : POINTER );
BEGIN

nbGetVar := @TVarGetProc( VarGetFunc );
nbSetVar := @TVarSetProc( VarSetFunc );
nbAddAction := @TAddActionProc( AddActionProc );
nbAddFile := @TAddFileProc( AddFileProc );

END;


PROCEDURE DLLHandler( Reason : INTEGER );
BEGIN
IF Reason = DLL_PROCESS_DETACH THEN
BEGIN
END;
END;
EXPORTS nbEditAction;
EXPORTS nbExecAction;
EXPORTS nbInitPlugIn;
EXPORTS nbRegisterPlugIn;
EXPORTS nbRegisterScriptProcessor;
EXPORTS nbRegisterInterfaceAccess;
EXPORTS nbMessage;

BEGIN
DLLProc := @DLLHandler;
END.



Really Thanks a lot for any HELP

from Corruptionland