Qbasicnews.com
February 26, 2020, 01:03:24 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Back to Qbasicnews.com | QB Online Help | FAQ | Chat | All Basic Code | QB Knowledge Base
 
   Home   Help Search Login Register  
Pages: 1 2 [3]
  Print  
Author Topic: I need some help in this since im new  (Read 9243 times)
yetifoot
Ancient Guru
****
Posts: 575



« Reply #30 on: April 10, 2006, 08:22:24 AM »

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.
Logged

EVEN MEN OF STEEL RUST.
Mac
Senior Member
**
Posts: 243


WWW
« Reply #31 on: April 10, 2006, 09:54:45 AM »

Quote from: "yetifoot"
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
Logged
anarky
Been there, done that
*****
Posts: 1231


The Blobworld Comics King


« Reply #32 on: April 10, 2006, 09:57:37 AM »

Same applies for DEFINT A-Z for integers.
Logged

Screwing with your reality since 1998.
yetifoot
Ancient Guru
****
Posts: 575



« Reply #33 on: April 10, 2006, 06:30:26 PM »

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.
Logged

EVEN MEN OF STEEL RUST.
Mac
Senior Member
**
Posts: 243


WWW
« Reply #34 on: April 10, 2006, 09:01:55 PM »

Quote from: "yetifoot"
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
Logged
KiZ
__/--\__
*****
Posts: 2879


WWW
« Reply #35 on: April 11, 2006, 06:03:08 AM »

Quote from: "yetifoot"
This is not a qb forum, this is newbie help.


It is quite clearly under the QB category in the index.
Logged
Moneo
Na_th_an
*****
Posts: 1971


« Reply #36 on: April 11, 2006, 09:36:03 PM »

Quote from: "Mac"
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.
*****
Logged
Anonymous
Guest
« Reply #37 on: April 11, 2006, 11:03:42 PM »

really, no need to cry, qbasic served its purpose for many years.
Logged
Pages: 1 2 [3]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!