Page 8 of 15

Re: PureBasic 5.40 LTS beta 3 is out !

Posted: Wed Sep 16, 2015 10:17 am
by JCV
Just wondering which library has increased in size. Maybe he used http library that now uses curl?
I'm using before curl dll but now no need. 200kb is small compared to added feature.

http://www.purebasic.fr/english/viewtop ... 36#p470736

Re: PureBasic 5.40 LTS beta 3 is out !

Posted: Wed Sep 16, 2015 11:04 am
by supercdfr
something that i never seen in purebasic but is in c : when you compile, make a warning about orphan variable.

Ex : the variable XXX is define but never use.

It's just a idea.

Re: PureBasic 5.40 LTS beta 3 is out !

Posted: Wed Sep 16, 2015 1:56 pm
by langinagel
@supercdr
some kind of a lint program would be fine for Purebasic - either inside the compiler or extern.
But this would require to define some common coding rules before:
no orphan variables,
no dead code,
just one procedurereturn per procedure,
...
MISRA rules or JSF could provide some orientation.

..and ..by the way:

THX Fred, Freak and all of PB team for the great work.

just a hint: checkinstall may need an update.

Greetings
LN

Re: PureBasic 5.40 LTS beta 3 is out !

Posted: Wed Sep 16, 2015 2:16 pm
by User_Russian
supercdfr wrote:something that i never seen in purebasic but is in c : when you compile, make a warning about orphan variable.
It is a good idea. It is a pity that the PB is not supported.
Example where necessary.

Code: Select all

EnableExplicit

Procedure.q File_Size(File.s)
  Protected Size.q
  Size=FileSize(File)
  ProcedureReturn Size
EndProcedure

Procedure.q File_Size_2(File.s)
  Protected Size,q
  Size=FileSize(File)
  ProcedureReturn Size
EndProcedure
It seems that these two procedures are identical, but File_Size_2() will return an incorrect result of its file size is greater than 2 GB.
Find this error is difficult.

Re: PureBasic 5.40 LTS beta 3 is out !

Posted: Wed Sep 16, 2015 3:02 pm
by HanPBF
As a first, single-pass compiler friendly solution:

Code: Select all

procedure test()
    beginProtected
       a.q
       b.s
       c.d
    endProtected
    ; ...
endProcedure ; test
or

Code: Select all

procedure test()
    var
       a.q
       b.s
       c.d
    endVar
    ; ...
endProcedure ; test

Re: PureBasic 5.40 LTS beta 3 is out !

Posted: Wed Sep 16, 2015 3:52 pm
by davenull
Great update, thanks!

I was testing the CGI library and it seems that the WriteCGIStringN command doesn't accept the string encoding parameter:

Code: Select all

WriteCGIStringN(Response, #PB_Ascii)
Result:
WriteCGIStringN(): Incorrect number of parameters.

Cheers.

Re: PureBasic 5.40 LTS beta 3 is out !

Posted: Thu Sep 17, 2015 8:23 am
by langinagel
There were voices here complaining about big library sizes.
I thought some kind of useless maximum would be interesting to see:

Code: Select all

UseSQLiteDatabase()
UsePostgreSQLDatabase()
UseODBCDatabase()
UseJPEG2000ImageDecoder()
UseJPEG2000ImageEncoder()
UseJPEGImageDecoder()
UseJPEGImageEncoder()
UsePNGImageDecoder()
UsePNGImageEncoder()
UseTGAImageDecoder()
UseTIFFImageDecoder()

UseBriefLZPacker()
UseJCALG1Packer()
UseLZMAPacker()
UseTARPacker()
UseZipPacker()
UseFLACSoundDecoder()
UseOGGSoundDecoder()

InitJoystick()
InitKeyboard()
InitMouse()
InitMovie()
InitNetwork()
InitSprite()

OpenConsole()

Input()
This ended up with 2,248,304 compiled Bytes under 5.40 beta with Ubuntu x86 Linux.

This might be big, but the current PC RAMs range higher. Even Raspberry Pi could work with this...
I have seen other compilers ending up with about 1 MB only for print "hello world".

So...don't worry, be happy.

Re: PureBasic 5.40 LTS beta 3 is out !

Posted: Thu Sep 17, 2015 11:41 am
by deseven
This api function stopped working in the latest beta:

Code: Select all

CreateSemaphore_(0,0,1,"test")
The error is "Bad parameter type, number expected instead of string."
According to msdn, the last parameter should be LPCTSTR. What should i do now? Send a pointer instead?

Re: PureBasic 5.40 LTS beta 3 is out !

Posted: Thu Sep 17, 2015 11:48 am
by Keya
yes change "test" to @"test"

Re: PureBasic 5.40 LTS beta 3 is out !

Posted: Thu Sep 17, 2015 12:08 pm
by deseven
Keya wrote:yes change "test" to @"test"
Thanks. Seems to be working.

Re: PureBasic 5.40 LTS beta 4 is out !

Posted: Fri Sep 18, 2015 5:22 pm
by Fred
Beta 4 is out ! Thanks all for testing.

Re: PureBasic 5.40 LTS beta 4 is out !

Posted: Fri Sep 18, 2015 5:45 pm
by freak
The following changes have been made to the VectorDrawing lib since beta 3:
  • The DotPath(), DashPath() & CustomDashPath() commands now have an optional 'StartOffset' parameter
  • The 'Distance' parameter of DotPath() has been changed: It now refers to the distance between the center of each dot (not the space between the dots)

Re: PureBasic 5.40 LTS beta 4 is out !

Posted: Fri Sep 18, 2015 11:04 pm
by deseven
Thanks!

However, there is something really wrong with at least some winapi functions.

Try this:

Code: Select all

; this one is ok
MessageBox_(0,"test","test",#MB_OK|#MB_ICONINFORMATION)

; this one will show yes and no buttons if the debugger is on
test.s = "test"
MessageBox_(0,"test" + test,"test",#MB_OK|#MB_ICONINFORMATION)

; this one will die with invalid memory access
test.s = "testtesttest"
MessageBox_(0,"test" + test,"test",#MB_OK|#MB_ICONINFORMATION)

; this one will fail to compile with assembler error (PureBasic.asm [237])
test.s = "test"
MessageBox_(0,"test " + test + "test","test",#MB_OK|#MB_ICONINFORMATION)

Re: PureBasic 5.40 LTS beta 4 is out !

Posted: Fri Sep 18, 2015 11:21 pm
by skywalk
deseven wrote:Thanks!
However, there is something really wrong with at least some winapi functions.

Code: Select all

[/quote]
[url=http://www.purebasic.fr/english/viewtopic.php?f=4&t=63349]Same problem mentioned here[/url] when concatenating strings in api calls.

Re: PureBasic 5.40 LTS beta 5 is out !

Posted: Sat Sep 19, 2015 9:17 am
by Fred
Beta 5 is out and only fix one bug with API and string concatenation (which could prevent further testing). On a side note, we have signed the OS X apps since the 5.40 beta, can OS X users tests if it works with gatekeeper activated ? The IDE should open after displaying a warning message without changing the default security features.