PBSource-Converter(v394 to v400) Released!

Developed or developing a new product in PureBasic? Tell the world about it.
User avatar
AL90
Enthusiast
Enthusiast
Posts: 217
Joined: Fri Sep 16, 2005 7:47 pm
Location: Germany
Contact:

PBSource-Converter(v394 to v400) Released!

Post by AL90 »

Hi,

What is the PBSourceConverter?
----------------------------------------

PBSourceConverter is a Plugin based "Multi-Pass Converter" with it you can converting PurBasic-Sources.
So you can make a compatible Sourcecode for a new PureBasic-Compiler. As alternative you can also make
compatible Sourcecodes to previously versions of PureBasic. So you must only create an own PluginFile for it.
The current version of Converter contains already the Plugin "PB394 to PB400".

DownLoad Link:

http://www.codersworkshop.com/viewshowcase.php?id=839

Image
Inf0Byt3
PureBasic Fanatic
PureBasic Fanatic
Posts: 2236
Joined: Fri Dec 09, 2005 12:15 pm
Location: Elbonia

Post by Inf0Byt3 »

Great job. I saved alot of time with your tool.
None are more hopelessly enslaved than those who falsely believe they are free. (Goethe)
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

Good idea and good job, but I still had some severe problems with my program after conversion because of an extremely tricky usage of ExamineDirectory(), NextDirectoryEntry() and OpenPreferences(). I can't even solve it manually. :lol:
User avatar
AL90
Enthusiast
Enthusiast
Posts: 217
Joined: Fri Sep 16, 2005 7:47 pm
Location: Germany
Contact:

Post by AL90 »

Thanks all! :wink:

@Trond

Yes, I'm known the problems with ExamineDirectory() and so on.
I'm have also problems with it and i can't it explain. :cry: :)
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

Actually, that code was correctly converted :D , but I was using NextDirectoryEntry() in an unsupported way. I got around it by using DisableDebugger and EnableDebugger.
User avatar
Flype
Addict
Addict
Posts: 1542
Joined: Tue Jul 22, 2003 5:02 pm
Location: In a long distant galaxy

Post by Flype »

This is very nice, usefull, welcome and well done !

I'm trying your converter on a big project.

Is it possible to do a rule for such case ?

( using PureCOLOR library for example )

Code: Select all

PureCOLOR_SetGadgetColor(#gList,#Black,$ffffff)
translated to :

Code: Select all

SetGadgetColor(#gList,#PB_Gadget_BackColor,$ffffff)
SetGadgetColor(#gList,#PB_Gadget_FrontColor,#Black)

2/
Is it possible to add the possibility to process a bunch of files ( convertion of all files of a project in a row ) ?

3/
In the 3.94 to 4.0, GetDatabaseLong() and GetDatabaseFloat is not converted.
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
User avatar
AL90
Enthusiast
Enthusiast
Posts: 217
Joined: Fri Sep 16, 2005 7:47 pm
Location: Germany
Contact:

Post by AL90 »

@Trond
Actually, that code was correctly converted. :D
I hope that. :D

Unsupported way? how?

@Flype
translated to :

Code:

SetGadgetColor(#gList,#PB_Gadget_BackColor,$ffffff)
SetGadgetColor(#gList,#PB_Gadget_FrontColor,#Black)
Normaly yes. you can add a new converting job for current plugin.
Is it possible to add the possibility to process a bunch of files ( convertion of all files of a project in a row ) ?
Includes? it comes in later versions. :wink:
In the 3.94 to 4.0, GetDatabaseLong() and GetDatabaseFloat is not converted.
hmm these commands are already supported by pluginfile. Get on Edit
and check the Pluginfile. Here the part of script from plugin.

Code: Select all

[BEGIN JOB]
OriginalName = GetDatabaseLong
ReplacedName = GetDatabaseLong
[ADD PARAMETER]
Position = 1
[FROM COMMAND]
CommandName = UseDatabase | OpenDatabase | OpenDatabaseRequester
Position = 1
[ALLOW #PB_ANY]
Position = 1
[END JOB]

[BEGIN JOB]
OriginalName = GetDatabaseFloat
ReplacedName = GetDatabaseFloat
[ADD PARAMETER]
Position = 1
[FROM COMMAND]
CommandName = UseDatabase | OpenDatabase | OpenDatabaseRequester
Position = 1
[ALLOW #PB_ANY]
Position = 1
[END JOB]
The values will be get so from UseDatabase and OpenDatabase. If the
value cannot recognize, the converter set a <value recognize failed>
dracflamloc
Addict
Addict
Posts: 1648
Joined: Mon Sep 20, 2004 3:52 pm
Contact:

Post by dracflamloc »

Hey this is cool. Thanks!
User avatar
AL90
Enthusiast
Enthusiast
Posts: 217
Joined: Fri Sep 16, 2005 7:47 pm
Location: Germany
Contact:

Post by AL90 »

No problem. :wink:
Thanks to all for interesting to my tool.
User avatar
fsw
Addict
Addict
Posts: 1572
Joined: Tue Apr 29, 2003 9:18 pm
Location: North by Northwest

Post by fsw »

Cool Tool :!:

The only thing that needed to be changed manually on a 45K source code was #PB_EventMenu and #PB_EventGadget.
(they changed to #PB_Event_Menu and #PB_Event_Gadget)

Even have to congratulate Fred & Co, because the exe size changed from 100k to 80k.
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Re: PBSource-Converter(v394 to v400) Released!

Post by PB »

> DownLoad Link:
> http://www.codersworkshop.com/viewshowcase.php?id=839

I get this error when clicking the zip link on the URL above:

Code: Select all

While trying to retrieve the URL:

The following error was encountered:

Connection Failed
The system returned:

    Error: Could not connect to server.
The remote host or network may be down. Please try the request again.

Your cache administrator is root.
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
rsts
Addict
Addict
Posts: 2736
Joined: Wed Aug 24, 2005 8:39 am
Location: Southwest OH - USA

Re: PBSource-Converter(v394 to v400) Released!

Post by rsts »

PB wrote:> DownLoad Link:
> http://www.codersworkshop.com/viewshowcase.php?id=839

I get this error when clicking the zip link on the URL above:
(snip)
[/code]
dunno - works fine for me (at 8:00PM EDT) :)

Great tool - many thanks for sharing with us.

cheers
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Re: PBSource-Converter(v394 to v400) Released!

Post by PB »

I still can't get it, nor can I see the screenshot of it. :(

@AL90: Can you mirror it somewhere more reliable? Thanks!
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
Lyon
User
User
Posts: 59
Joined: Tue Mar 28, 2006 9:26 pm

Post by Lyon »

Here ya go PB:

Image

Direct Download
Lyon
User
User
Posts: 59
Joined: Tue Mar 28, 2006 9:26 pm

Post by Lyon »

PS. Thanks AL90 for another great and free tool!
Post Reply