Jump to content

Assigning Strings to Variables


Dintiradan

Recommended Posts

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?!?!?!?!?!"

Link to comment
Share on other sites

Umm...

Code:
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.

Link to comment
Share on other sites

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).

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...