Page 1 of 3

jaPBe: Converting source to PB4

Posted: Tue Oct 10, 2006 8:50 am
by technicorn
Hi,

I've just started to port the latest sourcecode from gnozal for jaPBe to PB4.
So far it looks promising.
The IDE is already running, there are only some problems with the
compiler, it's not running yet, I get "compiler terminated" and a permanent timeout in the info window.
Hopefully I'll solve this problem today.

BTW: BlitzTools PB-converter helps a lot, without it, it would have taken
days to convert all the sources.
edit: Converter link: http://blitztools.de.vu/
Greatings,
technicorn

Posted: Tue Oct 10, 2006 8:54 am
by netmaestro
BlitzTools PB-converter
What is that? Is it AL90's converter? I can't find anything called that here or on google.

Posted: Tue Oct 10, 2006 2:25 pm
by gnozal
Please note the jaPBe uses undocumented PB3.9x features like EventwParam() and EventlParam(). I am not sure they work the same way in PB4.00 !

Posted: Tue Oct 10, 2006 3:40 pm
by Flype
EventwParam() and EventlParam() works OK in PB4.

Posted: Tue Oct 10, 2006 3:48 pm
by thamarok
Flype wrote:EventwParam() and EventlParam() works OK in PB4.
That's good. I don't know why they are not documented, but they help much if you don't want to write a lot of API code to get things done.

Posted: Tue Oct 10, 2006 3:50 pm
by Flype
they are not documented because - at the contrary of the PureBasic philosophy - these ones are Windows specifics.

Posted: Tue Oct 10, 2006 6:00 pm
by Tipperton
Flype wrote:they are not documented because - at the contrary of the PureBasic philosophy - these ones are Windows specifics.
I think they should still be documented somewhere for the benefit of those like me who are only interested in Windows development.

Posted: Wed Oct 11, 2006 9:36 am
by Heathen
Tipperton wrote:
Flype wrote:they are not documented because - at the contrary of the PureBasic philosophy - these ones are Windows specifics.
I think they should still be documented somewhere for the benefit of those like me who are only interested in Windows development.
I agree, could someone tell me what they functions do?

Posted: Wed Oct 11, 2006 9:42 am
by netmaestro
EventwParam() and EventlParam() are the equivalents to wParam and lParam in a Windows Callback, they allow you to access these values without setting up a callback, which is quite handy.

Posted: Wed Oct 11, 2006 10:05 am
by Flype
netmaestro wrote:EventwParam() and EventlParam() are the equivalents to wParam and lParam in a Windows Callback, they allow you to access these values without setting up a callback, which is quite handy.
Exactely.


to more precise, here is a small snippet :

Code: Select all

If OpenWindow(0,0,0,640,480,"test",#PB_Window_ScreenCentered)
  
  Repeat
    Select WaitWindowEvent()
      Case #WM_KEYUP
        Select EventwParam()
          Case #VK_RETURN: MessageRequester("", "Hello")
          Case #VK_ESCAPE: Break
        EndSelect
    EndSelect
  ForEver
  
  CloseWindow(0)
  
EndIf
which a simpler way to do this :

Code: Select all

Procedure MyCallback(WindowID, message, wParam, lParam)
  
  Protected result.l = #PB_ProcessPureBasicEvents
  
  Select message
    Case #WM_KEYDOWN
      Select wParam
        Case #VK_RETURN: MessageRequester("", "Hello")
        Case #VK_ESCAPE: SendMessage_(WindowID, #WM_CLOSE, 0, 0)
      EndSelect
  EndSelect
  
  ProcedureReturn result
  
EndProcedure

If OpenWindow(0,0,0,640,480,"test",#PB_Window_ScreenCentered)
  
  SetWindowCallback(@MyCallback())
  
  Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
  
EndIf
:wink:

Re: jaPBe: Converting source to PB4

Posted: Wed Oct 11, 2006 10:55 pm
by Blue
technicorn wrote:I've just started to port the latest sourcecode from gnozal for jaPBe to PB4.
Great initiative.

Can we help you in any way, with that ?

Posted: Wed Oct 11, 2006 11:03 pm
by Blue
Flype wrote:[...]
which a simpler way to do this :
:wink:
Er.. Ahh...
It seems to me that your first code snippet was the simpler of the two examples.
No?

Posted: Thu Oct 12, 2006 2:06 pm
by technicorn
Blue wrote:Great initiative.

Can we help you in any way, with that ?
Many thanks for the offer, but it's already finished, I hope :D .
I'm already make last changes using the converted version!

Hopefully I haven't introduced to many bugs :wink:

@gnozal: If you want to, I can send you the modified sources, I marked all places where I messed with the code with my nick.
I think it will make enhancements you want to incorporate into jaPBe far more easyer.
And could you or someone else host the updated source,
as I don't have webspace to put the files up.

Although the PB-compiler is still somewhat buggy, I hadn't any trouble compiling and running jaPBe for PB-V4

Greatings,
technicorn

Posted: Thu Oct 12, 2006 3:38 pm
by gnozal
technicorn wrote:@gnozal: If you want to, I can send you the modified sources, I marked all places where I messed with the code with my nick.
I think it will make enhancements you want to incorporate into jaPBe far more easyer.
And could you or someone else host the updated source, as I don't have webspace to put the files up.
Maybe you could find a place to upload your file so everybody could test your converted jaPBe and see if it's stable.
I suggest PureStorage http://purebasic.myftp.org ; there are also many free web providers.

Posted: Thu Oct 12, 2006 5:21 pm
by technicorn
Ok, here are a short info text, the executable and the new sources:

Info text
Zipped executable
Zipped sources

The unpacked exe is about 1.4 Mb, compared to the about 550 kb of the
PB-V3 compiled exe, but it includes the on error linenumber support.
But even without it, it's still about 1 Mb.

Just download and test.

Edit: Sorry, got wrong links, corrected and tested. Please try again :oops: