View previous topic :: View next topic |
Author |
Message |
JSH357

Joined: 02 Feb 2003 Posts: 1705
|
Posted: Fri Jan 16, 2004 4:57 pm Post subject: Translation, please? |
|
|
I keep getting this warning, which I believe is causing my script to not work. Could
somebody explain what the issue may be?
(I get about 30 different instances of it; the problem seems to have something to do with
local variable-passing)
WARNING: in line 740 of script countreserves in querybattles.hss
if(herobyslot(6) >= 1) then(count == count + 1)
built-in function equal is returning a value that isnt being discarded.
'count' is a local variable.[/code] |
|
Back to top |
|
 |
JSH357

Joined: 02 Feb 2003 Posts: 1705
|
Posted: Fri Jan 16, 2004 5:04 pm Post subject: |
|
|
Wait, nevermind, I was using the wrong "=" command. I always get that wrong. >_> |
|
Back to top |
|
 |
Sephyroth Renegade Rebel Redmage Class A Minstrel

Joined: 04 Feb 2003 Posts: 644 Location: Schmocation
|
Posted: Sat Jan 17, 2004 9:44 am Post subject: |
|
|
I don't see why you don't use "increment(count)" instead. _________________ im realy ded  |
|
Back to top |
|
 |
JSH357

Joined: 02 Feb 2003 Posts: 1705
|
Posted: Sat Jan 17, 2004 10:45 am Post subject: |
|
|
Potato, potato.
This is the way I do it in C, and it works just as well. |
|
Back to top |
|
 |
T-Master
Joined: 10 Dec 2003 Posts: 74
|
Posted: Sat Jan 17, 2004 2:53 pm Post subject: |
|
|
Dear Sephy,
VERBOSE COMMANDS ARE N00BBB!!
Sincerely,
Super Rare |
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Sat Jan 17, 2004 5:50 pm Post subject: |
|
|
Thank you ZB, I've learnt more from your post than the rest of the Board put together. _________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
SDHawk Silent One
Joined: 06 Jan 2003 Posts: 80
|
Posted: Sat Jan 31, 2004 1:16 pm Post subject: |
|
|
The proper way to do that in C would be count++; not count = count+1; _________________ "Why is it when they say an adult has the mind of a Sew, they lock him up, while Sews are allowed to run free in the streets."
 |
|
Back to top |
|
 |
JSH357

Joined: 02 Feb 2003 Posts: 1705
|
Posted: Sat Jan 31, 2004 5:48 pm Post subject: |
|
|
A. Whoops, I meant C++. And it works perfectly well in that...
B. Verbose commands are still for noobies! |
|
Back to top |
|
 |
SDHawk Silent One
Joined: 06 Jan 2003 Posts: 80
|
Posted: Sat Jan 31, 2004 6:15 pm Post subject: |
|
|
Actually, that applys to both Cs- in fact, that's where C++'s name comes from...C increased one step. The main reasoning I'd assume is it's faster to type, and probably slightly faster to call (with the =, it has to look up the variable twice, although don't quote me on that part). _________________ "Why is it when they say an adult has the mind of a Sew, they lock him up, while Sews are allowed to run free in the streets."
 |
|
Back to top |
|
 |
Cube Dimensional Traveller

Joined: 02 Feb 2003 Posts: 294
|
Posted: Sat Jan 31, 2004 7:35 pm Post subject: |
|
|
Quote: | Verbose commands are for noobies! |
I use increment() ;-;. To me, it's the equivalent of "variable++" in C++... Faster and easier to type for me, heh. But hey, to each his own, right?  |
|
Back to top |
|
 |
Flamer The last guy on earth...

Joined: 04 Feb 2003 Posts: 725 Location: New Zealand (newly discovered)
|
Posted: Sun Feb 01, 2004 12:10 am Post subject: |
|
|
it's all good... i suppose.
i myself don't like verbose either, but i've got nothing against it. _________________ If we were a pack of dogs, IM would be a grand Hound, CN would be a very ficious little pitball, and Giz...well, it doesn't matter breed he is, he'd still be a bitch
(no offense to anyone that was mentioned) |
|
Back to top |
|
 |
T-Master
Joined: 10 Dec 2003 Posts: 74
|
Posted: Sun Feb 01, 2004 1:15 pm Post subject: |
|
|
In no case is "increment(var, 1)" faster to type than "var++;". The first is longer in length by a significant amount, and has two keystrokes on the number row. The second also has two keystrokes on the number row, but they are the same key. If you're using the numpad to type "+", you're doing it wrong.
Kidding aside though, some people understand the code better if it's verbose, and that's a good enough argument for me. |
|
Back to top |
|
 |
Flamer The last guy on earth...

Joined: 04 Feb 2003 Posts: 725 Location: New Zealand (newly discovered)
|
Posted: Sun Feb 01, 2004 2:35 pm Post subject: |
|
|
it actually can be written as "increment(var)"
as it is default to add one, if the arguement is left out.
probably one reason people use verbose is for the understanding. _________________ If we were a pack of dogs, IM would be a grand Hound, CN would be a very ficious little pitball, and Giz...well, it doesn't matter breed he is, he'd still be a bitch
(no offense to anyone that was mentioned) |
|
Back to top |
|
 |
|