Qbasicnews.com

Full Version: Something is seriously screwed up
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
...With my QB1.1 IDE.
I decided to rewrite the engine to a text game I'm making. I was going to put the load map code in a SUB, called loadmap.
So I go to Edit -> New Sub, call it loadmap. Then I change the line to accept a parameter. So now it looks like:
Code:
SUB loadmap (fname$)
END SUB
And my cursor is right at the end of the SUB loadmap line. So I press enter, to get on with writing the code, and..."Blank lines are not allowed before SUB/Function line. Is remark OK?"
Jeesus! It's AFTER the SUB line, and Before the END SUB line! :x
[EDIT]Even more screwed up! Simple variable names like fn and fnumber are "duplicate definitions."
i think i may know the problem.... did you chnage the declare statment so that it has the parameter?
The declare statement is automatically put there by the IDE when you save your work.
And that doesn't explain fn and fnumber being invalid variable names.
And I got QB45 - much better.
i know it is put there automaticly but if you changed the sub i dont think it changes the declare. so are you sure the declare statment says
Code:
DECLARE loadmap (fname$)
and not
Code:
DECLARE loadmap
This is what I do:
Enter QBASIC.
Go to Edit -> New SUB, name it loadmap.
At the end of the SUB loadmap line I add (fname$). I press ENTER.
"Blank lines are not allowed..." etc.
But whatever, I got QB45.
so it works now? ok. hmm
No, it doesn't work now, it's still screwed up, but I'm using QB 4.5 now, so I'm OK.
wait wait wait... it works in 4.5 but NOT 1.1... ok...
The problem is the varible fname$, QB is interpretting this as though it were defined as:
Code:
DEF FName$ = <expr>
Variable names that start with the letters FN are causing duplicate definition errors because QB is trying to assign the name to a variable and a function.

The other thing to check when manually editting subroutine headers is that something like this doesn't happen:
Code:
SUB loadMap()
'
SUB loadMap(mapName$)

END SUB
'
END SUB

I've had problems with the IDE doing weird stuff like this before.
Tell me about it. :-?
Pages: 1 2