Posts: 3,616
Threads: 287
Joined: Jan 2003
...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."
f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.
Posts: 2,765
Threads: 138
Joined: Nov 2002
i think i may know the problem.... did you chnage the declare statment so that it has the parameter?
Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.
Posts: 3,616
Threads: 287
Joined: Jan 2003
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.
f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.
Posts: 2,765
Threads: 138
Joined: Nov 2002
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
Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.
Posts: 3,616
Threads: 287
Joined: Jan 2003
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.
f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.
Posts: 2,765
Threads: 138
Joined: Nov 2002
so it works now? ok. hmm
Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.
Posts: 3,616
Threads: 287
Joined: Jan 2003
No, it doesn't work now, it's still screwed up, but I'm using QB 4.5 now, so I'm OK.
f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.
Posts: 2,765
Threads: 138
Joined: Nov 2002
wait wait wait... it works in 4.5 but NOT 1.1... ok...
Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.
Posts: 691
Threads: 5
Joined: Apr 2002
The problem is the varible fname$, QB is interpretting this as though it were defined as:
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.
esus saves.... Passes to Moses, shoots, he scores!
Posts: 3,616
Threads: 287
Joined: Jan 2003
Tell me about it. :-?
f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.