old QB Defender game - anyone want to try to bring this up to speed?
#14
(04-01-2023, 09:36 PM)i'm mnrvovrfc Wrote: I just remembered I had the Williams classics cartridge for Super NES, but I spent far more time playing Joust than Defender...

I learned something about this latest presented source code. That CONST has become worthless. Declaring a function that returns a constant offers the chance of typing that "constant". Also another function like CHR$() could be used for the constant value to return if desired, and it could be built up in a variety of ways. Could use another user function, and could even employ recursion with moderation. What I'm trying to say is that I'm not used to seeing source code with a function definition which is just "function_name = value".

I proposed the thing about "COMMON SHARED" because the original source code might have depended on other separate files, especially those not written in BASIC, to be compiled by QuickBASIC or BASIC PDS and not interpreted by QBasic.

I only know the IDE gives me no errors with the COMMON, and it blows up with DIM SHARED.

As far as constants, they can be shared variables - all the programmer has to do is remember not to change the values. Or they can be functions, and they can't make that error. Either way, it's just a way to assign a meaningful word to a value. Which is better, you can judge by how happy people are with them. Does one perform faster? Does one lead to more programmer errors? Is one costlier to implement and maintain? Maybe it doesn't matter. But I agree we should be able to assign a type to constants.
Reply


Messages In This Thread
RE: old QB Defender game - anyone want to try to bring this up to speed? - by madscijr - 04-01-2023, 10:45 PM



Users browsing this thread: 32 Guest(s)