Page 1 of 2

PB2BB(TAG)

Posted: Fri May 20, 2005 1:49 pm
by Hroudtwolf
Just for fun , I made this PB-Code to BB(Tag)-Code converter.
If you post the converted code (without code xxx /code), the PureBasic keywords will be highlighted in your forums.
It is not a curiosity. But it made fun to create this tool.

The converted code looks so:

test.pb wrote: Declare TestProzedur(hallo.s)
Global quatsch.s
a$="123"
If a$="123"
TestProzedur(hallo.s)
EndIf


Procedure TestProzedur(hallo.s)
Debug "Hallo"
EndProcedure
; ExecutableFormat=Windows
; EOF
Updated V1.02

- 18 more keywords added
- repaired: BB-Tag wasn't closed on BASIC-remarks (;)
- added a scrollbar to codefield
- now, its posible to load files with more than one megabyte


----------------------------------------------------------------------------------
http://www.purearea.net/pb/showcase/sho ... p=0&sort=1
or
http://www.purebasic-lounge.de/dload.ph ... file_id=30
or
Download setup-file
----------------------------------------------------------------------------------

Posted: Fri May 20, 2005 2:38 pm
by ts-soft
is this a balloon exe with 1 MB of recycledata? :D
i have your exe packed with upx, 35.5 kb :mrgreen:

Posted: Fri May 20, 2005 2:56 pm
by Hroudtwolf
OK.

I will use upx, too. :D

Posted: Fri May 20, 2005 3:12 pm
by Hroudtwolf
Shit....

UPX doesn't work with my PB-Version.

I get an error-message.


Translated from german.
"Just a part of ReadMemoryProcess- or WriteMemoryProcess requests was given"

Posted: Fri May 20, 2005 3:35 pm
by ts-soft
here can you download my upx-gui: http://de.geocities.com/ts_softde/SFX_UPX-GUI.zip
or in console: upx --best --compress-icons=1 pp2bbcode.exe

Posted: Fri May 20, 2005 4:09 pm
by Hroudtwolf
Perfectly :-)

A lot of Thanks.

Posted: Fri May 20, 2005 4:46 pm
by Hroudtwolf
Updated:

- Now, the converter knows all PureBasic commands
Window.pb wrote: ;
; ------------------------------------------------------------
;
; PureBasic - Window example file
;
; (c) 2001 - Fantaisie Software
;
; ------------------------------------------------------------
;

;
; Open a window, and do some stuff with it...
;

If OpenWindow(0, 100, 200, 195, 260, #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget, "PureBasic Window")

MessageRequester("Information", "Click to move the Window", 0)
MoveWindow(200,200)

MessageRequester("Information", "Click to resize the Window", 0)
ReSizeWindow(320,200)

;
; This is the 'event loop'. All the user actions are processed here.
; It's very easy to understand: when an action occurs, the EventID
; isn't 0 and we just have to see what have happened...
;

Repeat
EventID.l = WaitWindowEvent()

If EventID = #PB_Event_CloseWindow
Quit = 1
EndIf

Until Quit = 1

EndIf

End



; ExecutableFormat=Windows
; EOF

Posted: Sat May 21, 2005 2:14 pm
by DoubleDutch
very nice :)

Posted: Sat May 21, 2005 2:20 pm
by DoubleDutch
What would be a good addition would be right-click paste (copies in and converts the text), and copy - same as your copy button.

What would be REALLY good is Fred changing the php for his bbs to do the conversion automatically...

-Anthony

Posted: Sat May 21, 2005 2:59 pm
by Hroudtwolf
@DoubleDutch

Thanks for the praise and your tip :-)

Posted: Sat May 21, 2005 9:28 pm
by Hroudtwolf
Updated V1.05

- "Paste PB 'n Convert" added
- PopupMenu added

Posted: Sat May 21, 2005 9:41 pm
by DoubleDutch
Works perfect. :)

-Anthony

..

Posted: Sun May 22, 2005 1:23 am
by NoahPhense
Very nice..

- np

Posted: Sun May 22, 2005 2:49 am
by Hroudtwolf
Thank you very much.
:oops:

Do you have any suggestions for the next version ?

Posted: Sun May 22, 2005 2:59 am
by NoahPhense
Hroudtwolf wrote:Thank you much.
Image

Do you have any tips?
How about formatting? Having it read for the spaces & tabs.

- np