Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Something is seriously screwed up
#1
...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.
Reply
#2
i think i may know the problem.... did you chnage the declare statment so that it has the parameter?
[Image: sig.php]
Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.
Reply
#3
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.
Reply
#4
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
[Image: sig.php]
Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.
Reply
#5
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.
Reply
#6
so it works now? ok. hmm
[Image: sig.php]
Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.
Reply
#7
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.
Reply
#8
wait wait wait... it works in 4.5 but NOT 1.1... ok...
[Image: sig.php]
Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.
Reply
#9
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.
esus saves.... Passes to Moses, shoots, he scores!
Reply
#10
Tell me about it. :-?
f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)