Assigning Strings to Variables
Author | Topic: Assigning Strings to Variables |
---|---|
Guardian
Member # 6670
|
written Tuesday, September 5 2006 11:47
Profile
Homepage
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
|
written Tuesday, September 5 2006 13:15
Profile
post code -------------------- 5.0.1.0.0.0.0.1.0... Posts: 508 | Registered: Thursday, May 29 2003 07:00 |
Master
Member # 4614
|
written Tuesday, September 5 2006 14:37
Profile
Homepage
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
|
written Tuesday, September 5 2006 14:39
Profile
Homepage
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
|
written Tuesday, September 5 2006 15:58
Profile
Homepage
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
|
written Tuesday, September 5 2006 16:58
Profile
Homepage
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
|
written Tuesday, September 5 2006 17:41
Profile
Homepage
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
|
written Wednesday, September 6 2006 07:37
Profile
Homepage
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
|
written Wednesday, September 6 2006 11:09
Profile
Homepage
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
|
written Wednesday, September 6 2006 18:19
Profile
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 |