Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Why won't this work?
#1
[syntax="qbasic"]SUB center (text$, hloc%)
LOCATE hloc%, 41 - INT(LEN(text$) / 2)
PRINT text$
END SUB[/syntax]

It says that LOCATE is an illegal function call :evil:. Anyone know why?
quote="Deleter"]judging gameplay, you can adaquately compare quake 4 with pong[/quote]
Reply
#2
Check the value of text$...it could easily be of zero length. Looks like you're using SCREEN 0 for this, eh? Also, make sure hloc% is a legal value.
I'd knock on wood, but my desk is particle board.
Reply
#3
It works with zero length ("") strings passed too,
but if the string length is >81 chars it will try to locate
a negative column and therefor generate an error.

Make sure the strins you pass is <82 chars long,
and as Adosorken said: that hlock% is a legal value
/post]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)