Assigning Strings to Variables

AuthorTopic: Assigning Strings to Variables
Guardian
Member # 6670
Profile Homepage #0
I've been getting a lot of errors from Alint in my scripts. All of them original when I assign a string to a variable. Is something else wrong, or do I have to use buffer calls instead of assigning strings to variables (I really want to make sure this is the problem before I go over all of my scripts)?

--------------------
We interrupt this scheduled quote to bring you a rant. Again.
WHAT? "WE HAVE DETECTED THE PRESENCE OF SPYWARE ON YOUR COMPUTER! PLEASE CLICK HERE FOR A FREE SCAN?!?!?!?!?!"
Posts: 1509 | Registered: Tuesday, January 10 2006 08:00
Infiltrator
Member # 3040
Profile #1
post code

--------------------
5.0.1.0.0.0.0.1.0...
Posts: 508 | Registered: Thursday, May 29 2003 07:00
Master
Member # 4614
Profile Homepage #2
char string[] = "Text";
char* string = "Text";

Or maybe there's a different string datatype used in BoA.

--------------------
-ben4808
Posts: 3360 | Registered: Friday, June 25 2004 07:00
Guardian
Member # 6670
Profile Homepage #3
Umm...string = "string";There's an error for every instance of this, at least in Alint.

EDIT: Beat to the post... by two seconds.

--------------------
IF I EVER BECOME AN EVIL OVERLORD:
I will never tell the hero "Yes I was the one who did it, but you'll never be able to prove it to that incompetent old fool." Chances are, that incompetant old fool is standing behind the curtain.

[ Tuesday, September 05, 2006 14:40: Message edited by: Dintiradan ]
Posts: 1509 | Registered: Tuesday, January 10 2006 08:00
Master
Member # 4614
Profile Homepage #4
Are you sure the variable string is the correct datatype (declared as a string)?

--------------------
-ben4808
Posts: 3360 | Registered: Friday, June 25 2004 07:00
Lifecrafter
Member # 6193
Profile Homepage #5
As far as I can tell, you can only assign a string in that way in the variables section. So for example

variables;
string test = "Test.";

Would be legitamate, but if you tried to write

test = "test";

Somewhere in the body of the script it returns an error. If you need to do this then I think you have to use get_buffer_text().

Edit: The problem isn't with Alint, I tried to assign a string in this way and got a missing semicolon error when I tested it in BOA (No, I wasn't missing a semicolon, I think its either the wrong format or just not a valid way to assign strings).

[ Tuesday, September 05, 2006 17:00: Message edited by: Lazarus. ]

--------------------
Guaranteed to blow your mind.

Frostbite: Get It While It's...... Hot?
Posts: 900 | Registered: Monday, August 8 2005 07:00
Guardian
Member # 6670
Profile Homepage #6
Yes, I did declare it as a string.

Guess I'm going to have to change my code. The only thing is that I'm getting errors from scripts I alpha tested before, script I could have sworn worked fine before. Oh well.

--------------------
IF I EVER BECOME AN EVIL OVERLORD:
If my mad scientist/wizard tells me he has almost perfected my Superweapon but it still needs more testing, I will wait for him to complete the tests. No one ever conquered the world using a beta version.
Posts: 1509 | Registered: Tuesday, January 10 2006 08:00
Law Bringer
Member # 4153
Profile Homepage #7
You didn't call your variable "string", did you? Because I'm certain that would cause errors...

--------------------
Gamble with Gaea, and she eats your dice.

I hate undead. I really, really, really, really hate undead. With a passion.
Posts: 4130 | Registered: Friday, March 26 2004 08:00
Guardian
Member # 6670
Profile Homepage #8
Don't worry, I didn't. Anyway, went over my code, changed everything so it used the buffer, and now it works. Why assigning a string to a declared variable gets a semicolon error is beyond me.

--------------------
IF I EVER BECOME AN EVIL OVERLORD:
I will not appoint a relative to my staff of advisors. Not only is nepotism the cause of most breakdowns in policy, but it also causes trouble with the EEOC.
Posts: 1509 | Registered: Tuesday, January 10 2006 08:00
The Establishment
Member # 6
Profile #9
Sounds like a possible bug, perhaps it should be added to the list.

--------------------
Your flower power is no match for my glower power!
Posts: 3726 | Registered: Tuesday, September 18 2001 07:00