PureBasic 6.00 released !

Developed or developing a new product in PureBasic? Tell the world about it.
GPI
PureBasic Expert
PureBasic Expert
Posts: 1394
Joined: Fri Apr 25, 2003 6:41 pm

Re: PureBasic 6.00 Alpha 3 released !

Post 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
User avatar
DeanH
Enthusiast
Enthusiast
Posts: 223
Joined: Wed May 07, 2008 4:57 am
Location: Adelaide, South Australia
Contact:

Re: PureBasic 6.00 Alpha 3 released !

Post 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
wayne-c
Enthusiast
Enthusiast
Posts: 335
Joined: Tue Jun 08, 2004 10:29 am
Location: Zurich, Switzerland

Re: PureBasic 6.00 Alpha 3 released !

Post by wayne-c »

To create DLL's is still not possible, right? When will this be available?
As you walk on by, Will you call my name? Or will you walk away?
User avatar
pdwyer
Addict
Addict
Posts: 2813
Joined: Tue May 08, 2007 1:27 pm
Location: Chiba, Japan

Re: PureBasic 6.00 Alpha 3 released !

Post 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
Paul Dwyer

“In nature, it’s not the strongest nor the most intelligent who survives. It’s the most adaptable to change” - Charles Darwin
“If you can't explain it to a six-year old you really don't understand it yourself.” - Albert Einstein
User avatar
jacdelad
Addict
Addict
Posts: 1431
Joined: Wed Feb 03, 2021 12:46 pm
Location: Planet Riesa
Contact:

Re: PureBasic 6.00 Alpha 3 released !

Post 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.
PureBasic 6.04/XProfan X4a/Embarcadero RAD Studio 11/Perl 5.2/Python 3.10
Windows 11/Ryzen 5800X/32GB RAM/Radeon 7770 OC/3TB SSD/11TB HDD
Synology DS1821+/36GB RAM/130TB
Synology DS920+/20GB RAM/54TB
Synology DS916+ii/8GB RAM/12TB
User avatar
pdwyer
Addict
Addict
Posts: 2813
Joined: Tue May 08, 2007 1:27 pm
Location: Chiba, Japan

Re: PureBasic 6.00 Alpha 3 released !

Post 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.
Paul Dwyer

“In nature, it’s not the strongest nor the most intelligent who survives. It’s the most adaptable to change” - Charles Darwin
“If you can't explain it to a six-year old you really don't understand it yourself.” - Albert Einstein
User avatar
Sicro
Enthusiast
Enthusiast
Posts: 538
Joined: Wed Jun 25, 2014 5:25 pm
Location: Germany
Contact:

Re: PureBasic 6.00 Alpha 3 released !

Post 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.
Image
Why OpenSource should have a license :: PB-CodeArchiv-Rebirth :: Pleasant-Dark (syntax color scheme) :: RegEx-Engine (compiles RegExes to NFA/DFA)
Manjaro Xfce x64 (Main system) :: Windows 10 Home (VirtualBox) :: Newest PureBasic version
User avatar
pdwyer
Addict
Addict
Posts: 2813
Joined: Tue May 08, 2007 1:27 pm
Location: Chiba, Japan

Re: PureBasic 6.00 Alpha 3 released !

Post 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
Paul Dwyer

“In nature, it’s not the strongest nor the most intelligent who survives. It’s the most adaptable to change” - Charles Darwin
“If you can't explain it to a six-year old you really don't understand it yourself.” - Albert Einstein
User avatar
chi
Addict
Addict
Posts: 1028
Joined: Sat May 05, 2007 5:31 pm
Location: Linz, Austria

Re: PureBasic 6.00 Alpha 3 released !

Post 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?
Et cetera is my worst enemy
User avatar
marcoagpinto
Addict
Addict
Posts: 939
Joined: Sun Mar 10, 2013 3:01 pm
Location: Portugal
Contact:

Re: PureBasic 6.00 Alpha 3 released !

Post by marcoagpinto »

@Fred

Yes, why not use GCC 11.2?
User avatar
RichAlgeni
Addict
Addict
Posts: 914
Joined: Wed Sep 22, 2010 1:50 am
Location: Bradenton, FL

Re: PureBasic 6.00 Alpha 3 released !

Post 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?
User avatar
chi
Addict
Addict
Posts: 1028
Joined: Sat May 05, 2007 5:31 pm
Location: Linz, Austria

Re: PureBasic 6.00 Alpha 3 released !

Post 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:
Et cetera is my worst enemy
User avatar
useful
Enthusiast
Enthusiast
Posts: 366
Joined: Fri Jul 19, 2013 7:36 am

Re: PureBasic 6.00 Alpha 3 released !

Post 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
Dawn will come inevitably.
User avatar
marcoagpinto
Addict
Addict
Posts: 939
Joined: Sun Mar 10, 2013 3:01 pm
Location: Portugal
Contact:

Re: PureBasic 6.00 Alpha 3 released !

Post by marcoagpinto »

@Fred:

At least create a compiler option in a combobox:
1) GCC 8.5
2) GCC 11.2
User_Russian
Addict
Addict
Posts: 1443
Joined: Wed Nov 12, 2008 5:01 pm
Location: Russia

Re: PureBasic 6.00 Alpha 3 released !

Post 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
Post Reply