If you fear the labels - avoid them. But there is no need to use'em. Yes, we don't need in all language possibilities (for example, ELSE) - but they give as comfort and straight logic in program flow. Labels are come from the old translators and they WAS comfortable and satisfy the needs of the past times. Today, their role - allow compatibility with old programs and language standards.
If your write a program for your own - it's your choice to use labels or not. But keep in mind - that labels is very hard in understanding for others (and they are slowing down program execution on modern CPU's).
QBASIC is a structured programming language, and for decision making (IF ... ELSE ... END IF) statements, you can either put the code you want to execute right in the IF statement, or put it in a separate SUB that you call. The labels, like NOPIK said, were from the older languages that weren't structured, and that were used with computers that had more severe memory limitation than ours today have.
You should strive to avoid using GOTO and GOSUB altogether. Without them, the only labels or line numbers you will need are for [tt]RESTORE/tt] statements to use prior to [tt]READ[/tt]ing from [tt]DATA[/tt] statements.
This revives a 20 year old arguement. For every rule I can probably find 10 exceptions that would mandate the opposite.
Probably of more importance is clean logic flow and documentation.
There is nothing worse that trying to remember why you did somthing a certain way 5 years after you did it. Especially after you've been exposed to other methods and you thinking has been re-ordered. Ed Fair
unixstuff@juno.com
Any advice I give is my best judgement based on my interpretation of the facts you supply. Help increase my knowledge by providing some feedback, good or bad, on any advice I have given.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.