Noob question, just starting.

Everything else that doesn't fall into one of the other PB categories.
shadowvox
User
User
Posts: 14
Joined: Wed Jul 10, 2019 4:38 pm

Noob question, just starting.

Post 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?
User avatar
skywalk
Addict
Addict
Posts: 3972
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: Noob question, just starting.

Post 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.
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
User avatar
Tenaja
Addict
Addict
Posts: 1948
Joined: Tue Nov 09, 2010 10:15 pm

Re: Noob question, just starting.

Post 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.)
Bitblazer
Enthusiast
Enthusiast
Posts: 733
Joined: Mon Apr 10, 2017 6:17 pm
Location: Germany
Contact:

Re: Noob question, just starting.

Post 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).
webpage - discord chat links -> purebasic GPT4All
User avatar
Tenaja
Addict
Addict
Posts: 1948
Joined: Tue Nov 09, 2010 10:15 pm

Re: Noob question, just starting.

Post 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.
shadowvox
User
User
Posts: 14
Joined: Wed Jul 10, 2019 4:38 pm

Re: Noob question, just starting.

Post by shadowvox »

Thank you all very much for your help.
shadowvox
User
User
Posts: 14
Joined: Wed Jul 10, 2019 4:38 pm

Re: Noob question, just starting.

Post 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
User avatar
skywalk
Addict
Addict
Posts: 3972
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: Noob question, just starting.

Post by skywalk »

Haha, surely you are not stunned.
This is the difference with compiled and managed software.
Now do Python or Javascript. :idea:
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
User avatar
the.weavster
Addict
Addict
Posts: 1537
Joined: Thu Jul 03, 2003 6:53 pm
Location: England

Re: Noob question, just starting.

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