Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
I need some help in this since im new
#31
For the spelling mistake bugs, i prefer Option Explicit to catch those. I do now tend to use the (a To z) format aswell, as i think it gives a clearer picture. I'm not very impressed with the Dim foo(3) being 0 To 3, and not 0 To 2 as i would expect.
EVEN MEN OF STEEL RUST.
[Image: chav.gif]
Reply
#32
Quote:For the spelling mistake bugs, i prefer Option Explicit to catch those.

I have not been to this forum in a while and there must be some assumptions I don't know about.

"Option Explicit"?

That is not a capability of QBasic that I know of. I always use it in Visual Basic. Has this forum converted to be a Visual Basic forum?

Anyway, in QBasic I sometimes use
DEFSTR A-Z
to do the equivalent of OPTION EXPLICIT.

And from time-to-time I change it to
DEFDBL A-Z just to see if I messed up on strings.

Mac
Reply
#33
Same applies for DEFINT A-Z for integers.
Screwing with your reality since 1998.
Reply
#34
I see, i only used QB a few times about 10 years ago so i don't remember, i assumed it had Option Explicit too.

This is not a qb forum, this is newbie help.
EVEN MEN OF STEEL RUST.
[Image: chav.gif]
Reply
#35
Quote:This is not a qb forum, this is newbie help.

Newbie in what? Chess? SuDoku? Programming such as Fortran, Cobol, C, HTML, IBM7090 Mainframe assembly code?

As it is called "QBasic News", I would assume a newbie in QBasic.

What is your logic?

Mac
Reply
#36
Quote:This is not a qb forum, this is newbie help.

It is quite clearly under the QB category in the index.
Reply
#37
Quote:I used to always just code DIMs like
DIM S(100) as integer
even though I planned to only use (1 to 100).

Why? Because it was quick and easy and I didn't mind wasting S(0).

However, I've come to appreciate (1 to 100) more, and certainly not to save one measly cell.

The reason: a good protection against this bug:
y%=S(leest1)
when I meant
y%=S(least1)

My spelling error will, of course, go unnoticed by QBasic. I get the equivalent of y%=S(0).

If I use (100) or (0-100) then y%=S(0) has a legal value and thus I get y%=0 and have a hard time finding this bug.

If I use (1-100) y%=S(0) will fail immediately (OUT OF RANGE).

Mac

Congrats, Mac, very good explanation.
*****
Reply
#38
really, no need to cry, qbasic served its purpose for many years.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)