Blitz+ code vs. BlitzBasic code?

BlitzPlus Forums/BlitzPlus Programming/Blitz+ code vs. BlitzBasic code?

Danni(Posted 2011) [#1]
Hi there. I am new here, but not really new to BlitzBasic, though I haven't really been able to dump money on Blitz for a while and now that I have purchased it (both Blitz+ and BlitzMax) it seems that the good old BlitzBasic Demo (I got from a book a few years back) has more or less been replaced my many other types of Blitz languages.

I am kind of at a loss here though and am having a major issue with my program just ceasing to function at a specific point. I didn't really know whether to post it here or in the bugs section, but I have a feeling that it has to do with some oversight on my part after moving to Blitz+.

My first question, though, is "What are the major differences between Blitz+ and the older BlitzBasic as far as functions?"

The program functions terrifically, without fail (even now) in the BlitzBasic demo that I have, but always freezes within a certain function.

The only thing that is remotely different between that function and the rest of the program is that I am using an Input$() function.

Some would call that alone a no-brainer, but if I comment out, or even delete that section... it still fails at the same spot.

The program is fairly tossed together in a ton of ways that I know can be simplified, but it's just a simple life counter/poison counter/die roller program for me and a few of my geeky buds to use when we play Magic, the Gathering on every other Wednesday.

If need be, I can post the whole program code, but I was a little reserved in overdoing my first post with a mountain of text.


Andy_A(Posted 2011) [#2]
There are some minor differenced between BlitzBasic and BlitzPlus.

Mainly the ones I've seen are:

Print in BB must be Print "" in B+

ReadPixelFast/WritePixelFast don't exist in BB

LockBuffer/UnLockBuffer don't either

Flip must be used in B+, not used in BB if using FrontBuffer (which is not used in B+, it's always BackBuffer).

Locate in BB is no longer available in B+

Those are the ones I can remember but I'm sure there are others. The other thing that comes to mind is to make sure you have the latest B+ update - v1.47.

Lastly, just post the code in a code box - [ codebox ] <<paste code here>> [ /codebox ] (without the spaces). It's a lot easier to find problems when looking at code than guessing what the error might be.

Last edited 2011

Last edited 2011


Zethrax(Posted 2011) [#3]
Does the code just stall, does the program end, or does it exit with an error message? If the latter, what's the error message? Do you have the BlitzPlus debugger enabled?

Try to use the Stop command to zero in on the exact line where things go pear shaped, and post that line here.


Danni(Posted 2011) [#4]
The code was just stalling. I could not end it (Shift + F5) and could not minimize it (Alt + Tab). I actually was forced to try a hard reboot, which would turn up an error that was akin to referencing a "bad" memory location in the RAM. (Which I know isn't the case.

I did snag the update while searching the forums for a fix.

I did manage to fix it by doing away with the Input$ command and making a small function that just scans the keys for legal characters for the character's name.

All in all I like it better now as it doesn't hold up the user until they type in a name now like it used to. That just seemed a bit clunky and unpolished to me anyway.

Thanks for the responses though, I am glad that there is not a ton of new things to try and relearn. Definitely a plus with my hectic time schedule as of late.


GaryV(Posted 2011) [#5]
Danni:

Blitz Plus Intro by Mark Sibly

This will help you overcome the problem you are having and will help you learn to write proper event driven code.

Last edited 2011


Danni(Posted 2011) [#6]
Thanks for that GaryV!!!

I will most definitely use that method in my next project, which is far larger than this one.