Page 1 of 1

Noob question, just starting.

Posted: Fri Jul 12, 2019 8:34 pm
by shadowvox
Hello. I learned Basic on a TSR-80, yes I'm old. In recent years I've tried my hand at all variations of C, and for some reason, just cannot get a grasp of it. About 5 years ago, I wanted to make a program for work to track tasks and inventory. I used Visual Basic, and it was a huge pain. But, in the end, it worked, but was over 12 Meg when completed, and had a lot of strange behavior. 2 days ago, I downloaded the free version of Pure Basic and have a nearly fully functional program that runs beautifully, and a very small size. Oh, and a crap ton faster.
But before I buy PureBasic and expand this program, can someone answer a couple questions?
1. VB has try for error trapping, does PureBasic have something like this?
2. Does it have a live debug so I can watch functions and variables as they change?

Re: Noob question, just starting.

Posted: Fri Jul 12, 2019 11:33 pm
by skywalk
1. VB has try for error trapping, does PureBasic have something like this?
Not really. The OnError compile option will give you access to the offending line in your debugged executable. But, the code is not safe to continue.
2. Does it have a live debug so I can watch functions and variables as they change?
Absolutely. Use the integrated IDE debugger and step through code and watch variables or write to debug window or view variable states. lots of debug support. More than VB6. Especially helpful is the memory viewer.

Re: Noob question, just starting.

Posted: Sat Jul 13, 2019 12:12 am
by Tenaja
I think someone made some macros to mimic the try-catch... Searching might get you something. (Try Google, if the search box can't do it.)

Re: Noob question, just starting.

Posted: Sat Jul 13, 2019 3:36 am
by Bitblazer
shadowvox wrote:1. VB has try for error trapping, does PureBasic have something like this?
It is definately different and i often have to write my own custom error handling during development A try/catch construct in other languages can be quicker to do during development, but with clean development, you have to write your custom error handling anyway. Having some generic try/catch error handler blow a register dump and a sourcecode reference into a customers face is really not what they should ever see ;)

From my experience, its a bit more work in PB, but it should be done anyway if you want to deliver a solid product your end users want to use. But if you really want to, you could imitate the usual try/catch handling with your own error handler.
shadowvox wrote:2. Does it have a live debug so I can watch functions and variables as they change?
Yes. Purebasic comes with 3 different debuggers where one runs inside the IDE, one standalone GUI debugger and one command line debugger IIRC (something i never use personally).

In general - PureBasic is a LOT more advanced than VB or VBA. VB ist just the glorified extension of their (office) scripting language environment (IMHO).

Re: Noob question, just starting.

Posted: Sat Jul 13, 2019 5:10 am
by Tenaja
Speaking of debugging tools, we also get the wonderful profiler that freak gave us. It shows you how much each function is used, etc. When trying to speed up a multi-function routine, this is a godsend.

Re: Noob question, just starting.

Posted: Sun Jul 14, 2019 1:30 pm
by shadowvox
Thank you all very much for your help.

Re: Noob question, just starting.

Posted: Mon Jul 15, 2019 7:19 pm
by shadowvox
I'm stunned! The program I wrote in VB 2012 was over 12Meg in size. The same program written in PureBasic is 152K

Re: Noob question, just starting.

Posted: Mon Jul 15, 2019 7:35 pm
by skywalk
Haha, surely you are not stunned.
This is the difference with compiled and managed software.
Now do Python or Javascript. :idea:

Re: Noob question, just starting.

Posted: Mon Jul 15, 2019 10:50 pm
by the.weavster
skywalk wrote:Now do Python or Javascript. :idea:
If it only requires Python's standard library and it's compiled with PyOxidizer it will be around 20mb.

This is still little more than a speck with modern HDD sizes/costs and download speeds though.