New to PB - learning from Kale's book
-
Median Joe
- New User

- Posts: 6
- Joined: Thu Aug 19, 2021 10:38 am
New to PB - learning from Kale's book
Hi guys,
I'm just starting out with PB and am learning from Kales's book, which is very good and easy to understand. The book is pretty old and there have been many additions to the libraries and language since it was written but I'm assuming they will all be backwards compatible with version 4.0? Having worked through the book I don't want to have to "unlearn" anything (I'm not interested in using PB for games or 3d, so I will skip those chapters).
I'm not new to programming, having used freepascal/Lazarus for several years, but OOP is not to my taste, and also I use Linux, and don't have a Windows licence, but Lazarus doesn't work well using Wine. Fortunately, PB works flawlessly on it (although not the IDE, but I only need the command line) so I can create my GUI programs on Linux and then compile for Windows using Wine.
Thanks in advance for any advice!
I'm just starting out with PB and am learning from Kales's book, which is very good and easy to understand. The book is pretty old and there have been many additions to the libraries and language since it was written but I'm assuming they will all be backwards compatible with version 4.0? Having worked through the book I don't want to have to "unlearn" anything (I'm not interested in using PB for games or 3d, so I will skip those chapters).
I'm not new to programming, having used freepascal/Lazarus for several years, but OOP is not to my taste, and also I use Linux, and don't have a Windows licence, but Lazarus doesn't work well using Wine. Fortunately, PB works flawlessly on it (although not the IDE, but I only need the command line) so I can create my GUI programs on Linux and then compile for Windows using Wine.
Thanks in advance for any advice!
Re: New to PB - learning from Kale's book
PB 5.73/6.00 is mostly compatible with 4.00. Generally it tells you when something is incompatible or deprecated.
But what exactly is your question?
But what exactly is your question?
Last edited by jacdelad on Sat Aug 21, 2021 2:45 am, edited 1 time in total.
Good morning, that's a nice tnetennba!
PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
-
Median Joe
- New User

- Posts: 6
- Joined: Thu Aug 19, 2021 10:38 am
Re: New to PB - learning from Kale's book
The book is 15 years old. I just wanted to ask whether everything in it is still valid. You've answered my question, thanks!
Re: New to PB - learning from Kale's book
No. Small changes will be needed, but as jacdelad said, PureBasic will alert you if you're trying to use an unsupported or changed command.Median Joe wrote: Fri Aug 20, 2021 4:28 pmI just wanted to ask whether everything in it is still valid
Re: New to PB - learning from Kale's book
The biggest change was when pointer typing was removed. Other changes are in the well-documented History (in Help). The Changes sections will be of interest.
-
Median Joe
- New User

- Posts: 6
- Joined: Thu Aug 19, 2021 10:38 am
Re: New to PB - learning from Kale's book
Thanks, I didn't see that section in the help file. It seems there were 77 changes and 37 removals since version 4.0. Of course there were lots of additions too, including Maps, which aren't mentioned in the book. I've just discovered ninelizards.com, which is very helpful for learning and more up to date than the book.
Re: New to PB - learning from Kale's book
I always use the PB IDE in linux. (PB 5.73)
What is your problem with it?
What is your problem with it?
-
Median Joe
- New User

- Posts: 6
- Joined: Thu Aug 19, 2021 10:38 am
Re: New to PB - learning from Kale's book
Not sure why you think I have a problem with the IDE? But as you ask, I'm a long time Vim user which makes it hard to use any other editor. If the IDE (which is very good) had Vim bindings I would definitely use it, but I don't think that's going to happen. 
Re: New to PB - learning from Kale's book
Welcome to PureBasic.
The purebasic IDE can be customized. The information how to do it is here. So you could just set the most important shortcuts to the VIM settings you are used to.
The purebasic IDE can be customized. The information how to do it is here. So you could just set the most important shortcuts to the VIM settings you are used to.
-
Median Joe
- New User

- Posts: 6
- Joined: Thu Aug 19, 2021 10:38 am
Re: New to PB - learning from Kale's book
Hi BitBlazer, thanks for the tip. The IDE has many great features, but it's not a modal editor like Vim. Sure, I can set up shortcuts which will reduce "mouse mileage", but they won't eliminate it completely. Editing consists mainly of typing and manipulating text, which in Vim can ALL be done without ever having to leave the keyboard. Having learned it, it's very hard to go back to a conventional editor. I see there is a PB extension for Visual Studio Code, which also provides Vim bindings, so I may give that a try in place of vanilla Vim.
Re: New to PB - learning from Kale's book
Hey Median Joe,
I'm in the same boat ... learning PureBasic from Kale's book but supplementing it with Pure Basic Survival Guide and with Guillaume's excellent Pure Programming video series.
Some of the 'gotchas' I learned early on is that PB's default data type is no longer the 'long'(.l) but the 'integer'(.i). Also, ValQ ( StrQ as well) is mentioned in the book but is deprecated - the PB compiler will still run it but gives you a warning in the debugger.
Cheers,
Gary
I'm in the same boat ... learning PureBasic from Kale's book but supplementing it with Pure Basic Survival Guide and with Guillaume's excellent Pure Programming video series.
Some of the 'gotchas' I learned early on is that PB's default data type is no longer the 'long'(.l) but the 'integer'(.i). Also, ValQ ( StrQ as well) is mentioned in the book but is deprecated - the PB compiler will still run it but gives you a warning in the debugger.
Cheers,
Gary
Gary E Chike DMD MS
'Experience is what you get when you don't get what you want'
'Experience is what you get when you don't get what you want'

Re: New to PB - learning from Kale's book
I've always wondered why this is a "gotcha". I never changed my variables and my apps don't run any different? Is it because I'm using the 32-bit version?chikega wrote: Sat Aug 28, 2021 6:50 amSome of the 'gotchas' I learned early on is that PB's default data type is no longer the 'long'(.l) but the 'integer'(.i)
Re: New to PB - learning from Kale's book
Yes, that will be a problem when switching from 32bit to 64bit.BarryG wrote: Sat Aug 28, 2021 8:27 amI've always wondered why this is a "gotcha". I never changed my variables and my apps don't run any different? Is it because I'm using the 32-bit version?chikega wrote: Sat Aug 28, 2021 6:50 amSome of the 'gotchas' I learned early on is that PB's default data type is no longer the 'long'(.l) but the 'integer'(.i)
An integer is adapted to the operating system. If you use handles or ID's as long on 64bit system, it can lead to addressing errors.
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Re: New to PB - learning from Kale's book
So even though I compile with 32-bit PureBasic, I should search/replace any ".l" with ".i" and my exe still work on both 32-bit and 64-bit PCs?
Re: New to PB - learning from Kale's book
Yes,
But see if a LONG is explicitly required somewhere. For example as a filter or conversion, and special structures ...
But see if a LONG is explicitly required somewhere. For example as a filter or conversion, and special structures ...
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive



