Page 12 of 42

Re: PureBasic 6.00 Alpha 3 released !

Posted: Wed Aug 04, 2021 2:52 pm
by GPI
HeX0R wrote: Tue Aug 03, 2021 11:46 am First of all, this is no "really bad code".
This is how OpenWindow() worked since ... the beginning(?), it returned the OS handle.
It *IS* really bad code, because it is not documentated. You used a undocumented feature and undocumented feature can change *every* version without noticing it.

When you want a secure and stable code, DONT USE THIS KIND OF THINGS!

btw. you could "macro" the openwindow, when you really want this feature. In this case it will work allways:

Code: Select all

procedure _openwindow(id,...)
  x=openwindow(id,...)
  if id = #pb_any
    procedurereturn x
  elseif x
    procedurereturn windowid(id)
  endif
  procedurereturn 0
endprocedure
macro openwindow(id,...)
  _openwindow(id,...)
endmacro

Re: PureBasic 6.00 Alpha 3 released !

Posted: Thu Aug 05, 2021 12:26 am
by DeanH
Actually I am using pbPDF and I think it is the latest version. My mistake calling it PurePDF. Here are the first few lines of source code:

Code: Select all

;/ ============================
;/ =     pbPDF-Module.pbi     =
;/ ============================
;/
;/ [ PB V5.7x / All OS ]
;/
;/  © 2020 Thorsten1867 (12/2018)
;/ ( based on 'PurePDF' by LuckyLuke / ABBKlaus / normeus )
;/

; Last Update: 05.05.2020

Re: PureBasic 6.00 Alpha 3 released !

Posted: Thu Aug 05, 2021 7:40 pm
by wayne-c
To create DLL's is still not possible, right? When will this be available?

Re: PureBasic 6.00 Alpha 3 released !

Posted: Mon Aug 16, 2021 5:59 am
by pdwyer
Thank you Fred!!

One thing I have noticed with Alpha3 is that it's stricter on datatypes at runtime but compile time isn't catching them.

I have quite a bit of code where I'm using .l (long) rather than .i and so the return value is 32bits and not 64bits.

Documentation for functions like:

Code: Select all

Result = LoadFont(#Font, Name$, YSize [, Flags])
Result = ReadFile(#File, Filename$ [, Flags])
don't say that the value can't be a long (that I've noticed) and in v5.x this works fine to have longs
In 6.0 it compiles fine but when you run it crashes. when you run in the debugger you get a runtime error of:
[ERROR] The specified #File is not initialised
when the "result" is used later in the code to say read from the file.
Changing the data type to .i from .l solves the issue.

Since this is suddenly stricter at runtime, perhaps the compiler should catch it at compile time and say that the data type is incorrect.

Anyway, easily worked around for me for now!

Cheers

Re: PureBasic 6.00 Alpha 3 released !

Posted: Mon Aug 16, 2021 9:14 am
by jacdelad
I may be wrong and I've seen some discussions here already, but the result is always a handle which is depending on the OS always 32 or 64 bits long. So for this you should always use .i anyway.

Re: PureBasic 6.00 Alpha 3 released !

Posted: Mon Aug 16, 2021 11:00 am
by pdwyer
Agree, I've seen it in discussions
I don't mean this is a huge issue either.

Simple point is that
- It's not mentioned in the built-in functions that require it.
- The behavior has changed with v6 such that it is a requirement now and wasn't really before.

Perhaps all that's needed is note in the docs where it's needed to say that the datatype needs to match the 86/64 compile type

Actually I was impressed that when I installed v6a3 I compiled a few of my apps and other than this minor thing, everything compiles and runs fine! :)

I'm going to use v6 from now on and report an differences I see since there is not really any inconvenience to me in using it even though its alpha.

Re: PureBasic 6.00 Alpha 3 released !

Posted: Mon Aug 16, 2021 6:30 pm
by Sicro
@pdwyer It is mentioned in the PB help under General Syntax Rules:
Others
[...]
- Return values of commands are always Integer if no other type is specified in the Syntax line of the command description.
But I agree with you that the return type should rather be mentioned in the function descriptions.

Re: PureBasic 6.00 Alpha 3 released !

Posted: Tue Aug 17, 2021 6:10 am
by pdwyer
Thanks! Good to know.

Well, it's just a minor behavior change then for people who weren't quite doing the right thing :P

Re: PureBasic 6.00 Alpha 3 released !

Posted: Thu Aug 19, 2021 4:35 pm
by chi
@Fred: Is there a particular reason why PB6 uses GCC 8.1 (from 2018) and not the latest 11.2, or at least the series 8 bug-fix release 8.5?

Re: PureBasic 6.00 Alpha 3 released !

Posted: Thu Aug 19, 2021 4:45 pm
by marcoagpinto
@Fred

Yes, why not use GCC 11.2?

Re: PureBasic 6.00 Alpha 3 released !

Posted: Thu Aug 19, 2021 5:03 pm
by RichAlgeni
marcoagpinto wrote: Thu Aug 19, 2021 4:45 pm @Fred

Yes, why not use GCC 11.2?
I was wondering that myself. Also, will we be able to call assembler code in the new version?

Re: PureBasic 6.00 Alpha 3 released !

Posted: Fri Aug 20, 2021 7:03 am
by chi
According to these Benchmarks, it's not that bad to work with Series 8... But maybe you should consider switching to the final version 8.5 :wink:

Re: PureBasic 6.00 Alpha 3 released !

Posted: Fri Aug 20, 2021 8:54 am
by useful
To be honest, I was hoping for something similar ...
https://rapideuphoria.com/e2c.htm
Command-Line Options

If you happen to have more than one C compiler for a given platform, you can select the one you want to use with a command-line option:
-bor
-lcc
-wat
-djg
on the command line to ec or ecw. e.g.

ecw -bor pretend.exw

Normally, after building your .exe file, the emake batch file will delete all C files and object files produced by the Translator. If you want emake to keep these files, add the -keep option to the Translator command-line. e.g.

ec -wat -keep sanity.ex

Re: PureBasic 6.00 Alpha 3 released !

Posted: Fri Aug 20, 2021 9:24 am
by marcoagpinto
@Fred:

At least create a compiler option in a combobox:
1) GCC 8.5
2) GCC 11.2

Re: PureBasic 6.00 Alpha 3 released !

Posted: Fri Aug 20, 2021 10:03 am
by User_Russian
marcoagpinto wrote: Fri Aug 20, 2021 9:24 am @Fred:
Fred has not been on the forum for a long time...
Image