[Not a bug] good old print()

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: [Not a bug] good old print()

by cccp_leha » Sat Nov 15, 2003 3:18 pm

Prints nothing.

by Hirogen2 » Sat Nov 15, 2003 1:30 am

randy wrote:Because you're adding two different numbers together to get a different number. Suppose those two strings are numbers 1 and 2 in the string table. Then your code is equivalent to this:

Code: Select all

print(s:1 + 2);
So it will print the string at index 3.
What if there is no index 3 in the ACS file? Segfault? Printing the byte opcodes?

by cccp_leha » Fri Nov 14, 2003 8:57 pm

Thanks for the info.

by randi » Fri Nov 14, 2003 8:28 pm

Because you're adding two different numbers together to get a different number. Suppose those two strings are numbers 1 and 2 in the string table. Then your code is equivalent to this:

Code: Select all

print(s:1 + 2);
So it will print the string at index 3.

by cccp_leha » Fri Nov 14, 2003 8:11 pm

Hah, I knew it wasn't a bug. And why does it print an irrelevant message?

by randi » Fri Nov 14, 2003 7:48 pm

No, it's not a bug, since ACC doesn't have an actual string type. Strings are just numbers that can be manipulated like any other number.

good old print()

by cccp_leha » Fri Nov 14, 2003 7:47 pm

I somehow stumbled across the following. If try you concatenate with a "+" like so:

Code: Select all

print(s:"this is togethered by " + "a plus");
it compiles with no errors, but prints out a different message, most likely the first one immediately following it in the code. blabla, not sure if this is a bug, blabla.

Top