Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Compiler Returncode
#8
I can't see what's wrong with the compiler throwing up an error there? What's the problem?


poke uinteger @PropPrintTxtadr,txtadr

Has an issue - what is txtadr? Quite reasonably, the compiler doesn't know. So it assumes it's a float, and probably calls it zero. And warns you:

02:23:11 -> temp.bor:1: warning: Variable 'txtadr' declared as 'float'. Compilation failed

If you go with:

poke uinteger PropPrintTxtadr,txtadr

Well, now the compiler has two pieces of text that aren't numbers or defined variables. So it throws a fit about that too. It doesn't know what PropPrintTxtadr should be, so it defines a float, and tries to carry on. But it does warn you. (@text must refer to a label. Just text means it's a variable).

The problem is then, that if it's defined as a variable by the compiler, since it didn't know what to do with it, when it hits the label it REALLY throws a fit, because it's already defined PropPrintTxtadr...

I'm a little confused - Am I missing something here? It seems pretty clear cut to me.
(Though, Boriel, if you are listening, I actually strongly DISLIKE this behavior - where something unknown is made into a variable automatically. I'd MUCH prefer the compiler to stop with an error, there. One mistyped variable name and the code still compiles; but obviously doesn't work... I'd rather know about it in no uncertain terms! Can we at least have a compiler option that makes it stop instead of warn if something isn't defined with a DIM or a LET already?)
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)