jaPBe 3.13.4 [IDE for PB 4 and PB 5]

All PureFORM, JaPBe, Libs and useful code maintained by gnozal

Moderator: gnozal

nicolaus
Enthusiast
Enthusiast
Posts: 456
Joined: Tue Aug 05, 2003 11:30 pm
Contact:

Post by nicolaus »

after the update from PB to 4.01 i can´t debug with jaPBe
User avatar
dobro
Enthusiast
Enthusiast
Posts: 766
Joined: Sun Oct 31, 2004 10:54 am
Location: France
Contact:

Post by dobro »

nicolaus wrote:after the update from PB to 4.01 i can´t debug with jaPBe
it work perfectly ! :shock:
Image
Windows 98/7/10 - PB 5.42
■ sites : http://michel.dobro.free.fr/
dige
Addict
Addict
Posts: 1391
Joined: Wed Apr 30, 2003 8:15 am
Location: Germany
Contact:

Post by dige »

Same Problem here, but only with "ThreadSafe" enabled
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 might be a PB bug, more than a jaPBe bug (?)

See the bug report here :
http://www.purebasic.fr/english/viewtopic.php?t=24429
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
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

@ dobro
Sorry, I can't reproduce the problem.
I tried this :
Open jaPBe
Create new tab (1)
Paste your code
Find 'bmp' (Min/Maj checked) : works ok
Create new tab (2)
Paste your code
Find 'bmp' : works ok in both tabs
Do you use some codepage <> 0 ?

@ nicolaus & dige
It seems to be a PB problem. jaPBe only calls the (external) debugger, PB does the rest.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
User avatar
dobro
Enthusiast
Enthusiast
Posts: 766
Joined: Sun Oct 31, 2004 10:54 am
Location: France
Contact:

Post by dobro »

c'est a rien comprendre apres une eniem reinstal , ça marche Now ! :lol:

it has anything not to include/understand there after a eniem reinstalment, it goes maintenant
Image
Windows 98/7/10 - PB 5.42
■ sites : http://michel.dobro.free.fr/
User avatar
Flype
Addict
Addict
Posts: 1542
Joined: Tue Jul 22, 2003 5:02 pm
Location: In a long distant galaxy

Post by Flype »

Hello gnozal,

Just 2 small things :

1/

If we switch On or Off the "Inline ASM" in the compiler options, then the ASM lines are not automatically colored/uncolored.
You can try with this ASM sample for example :

Code: Select all

var.l
bug.l

  MOV   eax,var   ;as workaround use !mov eax,[v_var] instead
  ADD   eax,1
  MOV   bug,eax
  MOV   var,eax   
 
MessageRequester("value", Str(bug))
End 
2/

In the compiler option panel, Is it possible to add an easy way to specify a default icon for the generated excutable.
jaPBe could provide a default purebasic icon, this could be useful for lazy programmer or for quick'n'dirty executables.
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
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

Flype wrote:1/ If we switch On or Off the "Inline ASM" in the compiler options, then the ASM lines are not automatically colored/uncolored.
They are, but the display is not updated (move the carret with the up/down keys, you will see the change). Fixed.
Flype wrote:2/ In the compiler option panel, Is it possible to add an easy way to specify a default icon for the generated excutable.
jaPBe could provide a default purebasic icon, this could be useful for lazy programmer or for quick'n'dirty executables.
Yes, it could be handy. I am lazy too :wink:
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

Update 3.6.11

Changes :
- some fixes
- added default project icon in preferences
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
nicolaus
Enthusiast
Enthusiast
Posts: 456
Joined: Tue Aug 05, 2003 11:30 pm
Contact:

Post by nicolaus »

@gnozal

I hafe found a prob in jaPBE with this code.
In the orgnial IDE i can compiled this but in jaPBe a hafe a ASM error.

Settings in jaPBe and orginal IDE:
ASM: on
OnError: on

Code: Select all

!EXTRN _PB_2DDrawing_GlobalStructure

Procedure StartDrawingEx(hWindow)
  Protected hdc.l
 
  hdc = GetDC_(hWindow)
 
  !MOV Eax, [p.v_hDC]
  !MOV [_PB_2DDrawing_GlobalStructure], Eax
 
  ProcedureReturn 1
EndProcedure

Procedure StopDrawingEx(hWindow)
  Protected hdc.l
 
  hdc = 0
 
  !MOV Eax,[_PB_2DDrawing_GlobalStructure]
  !MOV [p.v_hDC], Eax
 
  ReleaseDC_(hWindow, hdc)
EndProcedure

OpenWindow(0, 0, 0, 640, 480, "Test")

Repeat
  StartDrawingEx(WindowID(0))
  Box(10, 10, 400, 300, RGB(255, 0, 0))
  LineXY(200, 100, 250, 300, RGB(255, 255, 0))
  StopDrawingEx(WindowID(0))
  Delay(10)
Until WindowEvent() = #PB_Event_CloseWindow
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

@ Nicolaus
I also get an ASM error using the PBIDE or the command line compiler (test.pb is your code), with or without ASM enabled :
C:\PureBasic400\Compilers>pbcompiler test.pb

******************************************
PureBasic v4.01 (Windows - x86)
******************************************

Compiling test.pb
Loading external libraries...
Starting compilation...
33 lines processed.
Creating executable.
Error: Assembler
PureBasic.asm [162]:
MP0
PureBasic.asm [81] MP0 [10]:
MOV Eax, [p.v_hDC]
error: undefined symbol.
Anyway, there is sometimes a problem with jaPBe when !EXTRN _PB_InternalStuff is used, probably a path problem (the PB IDE perhaps changes the path before compiling ?). You may fix it by changing the working path in the projects options ( F8 ) to %Purebasic%\Compilers)

And Fred said you don't need this hack anymore :

Code: Select all

Structure PB_2DDrawingInfo 
  *hDC 
  ; There is more stuff here, but we try to keep this private 
EndStructure 


Import "kernel32.lib" ; It's not in the kernel32.lib, but it's the one always linked :) 
  PB_2DDrawing_GlobalStructure.PB_2DDrawingInfo   ; For non-threaded 
  PB_2DDrawing_Globals           ; For threadedsafe mode 
  PB_Object_GetThreadMemory(*Globals) 
EndImport 


Procedure StartDrawingEx(hWindow) 
  
  CompilerIf #PB_Compiler_Thread 
  
    *Globals.PB_2DDrawingInfo = PB_Object_GetThreadMemory(PB_2DDrawing_Globals) 
    *Globals\hDC = GetDC_(hWindow) 
    
  CompilerElse 
  
    PB_2DDrawing_GlobalStructure\hDC = GetDC_(hWindow) 
    
  CompilerEndIf 
  
  ProcedureReturn 1 
EndProcedure 

Procedure StopDrawingEx(hWindow) 
  
  CompilerIf #PB_Compiler_Thread 
  
    *Globals.PB_2DDrawingInfo = PB_Object_GetThreadMemory(PB_2DDrawing_Globals) 
    ReleaseDC_(hWindow, *Globals\hDC) 

  CompilerElse 
  
    ReleaseDC_(hWindow, PB_2DDrawing_GlobalStructure\hDC) 
    
  CompilerEndIf 
  
EndProcedure 

OpenWindow(0, 0, 0, 640, 480, "Test") 

Repeat 
  StartDrawingEx(WindowID(0)) 
  Box(10, 10, 400, 300, RGB(255, 0, 0)) 
  LineXY(200, 100, 250, 300, RGB(255, 255, 0)) 
  StopDrawingEx(WindowID(0)) 
  Delay(10) 
Until WindowEvent() = #PB_Event_CloseWindow
This code also works in jaPBe.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
User avatar
Flype
Addict
Addict
Posts: 1542
Joined: Tue Jul 22, 2003 5:02 pm
Location: In a long distant galaxy

Post by Flype »

hello gnozal,

1/

i tried the update you made for the default icon, but how it works ?
by definining the icon in menu->prefrences->project->icon ?

can you provide inside the jaPBe archive a default icon (.../jaPBeForPB400_3611/project.ico)
which is - by design - already defined into the icon field (in the prefs->project page) ?

2/

just an another idea :idea:

sometimes, when a program (purebasic-made) crash or fall into an endless loop, programmer have to kill it himself in the processus list (Ctrl+Alt+Sup).

if debugger is ON, it's easy to stop it !

but if the debugger is OFF,
it would be very handy to stop the program directly from jaPBe.

i think it can be done by getting the PID of the running program and then 'kill' it.
does the purebasic sdk send you the PID after compiling/running it ? if so it would be trivial...


one more time, an option for lazy programmers :D
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
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

Flype wrote:1/

i tried the update you made for the default icon, but how it works ?
by definining the icon in menu->prefrences->project->icon ?
Yes, that's the idea. This icon should appear in every new project.
Flype wrote:Can you provide inside the jaPBe archive a default icon (.../jaPBeForPB400_3611/project.ico)
which is - by design - already defined into the icon field (in the prefs->project page) ?
Ok, will see, but I don't want to force this icon. The [...] button will point to this default icon if it exists.
Flype wrote:2/

just an another idea :idea:

sometimes, when a program (purebasic-made) crash or fall into an endless loop, programmer have to kill it himself in the processus list (Ctrl+Alt+Sup).

if debugger is ON, it's easy to stop it !

but if the debugger is OFF,
it would be very handy to stop the program directly from jaPBe.

i think it can be done by getting the PID of the running program and then 'kill' it.
does the purebasic sdk send you the PID after compiling/running it ? if so it would be trivial...
I have the compiler process ID, but the SDK does not send the running program ID (AFAIK, there is no documentation about the compiler SDK), and the compiler chooses the EXE name if compile/run.
It's done like this in jaPBe :

Code: Select all

PostThreadMessage_(CompilerThreadID, PB_MSG_ID, #PB_MSG_Start_Compilation, flags)
Perhaps the PID is sent via a #PB_MSG_* message after PostThreadMessage_(), but I don't know it.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

Update

Minor changes :
- added some icons in %jaPBe%\Icons
- the icon (chosen with the [...] button) in Preferences/Project is %jaPBe%\Icons\DefaultProject.ico by default.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
mknjc
New User
New User
Posts: 4
Joined: Sun Oct 15, 2006 11:08 am

Post by mknjc »

Hi Gonzal,

please add a support for folding If's and Select's.
I hope thats make my Programm more clearly.

Mfg mknjc
Post Reply