mIRC Homepage
Posted By: Krafo In simple words..a variable is? - 31/08/03 02:13 AM
Hi ppl, can someone explain to me (in simple words) exactly what is a variable and in what occassions they are used and so on? Cause i have read the section in the mIRC Help File regarding variables several times, but i still cannot understand anything. I don't know how can i learn scripting, the mirc.hlp file is too difficult, it does't give you in what occassions they are used and so on.

Regards
Chris.
Posted By: Raccoon Re: In simple words..a variable is? - 31/08/03 02:39 AM
A Variable allows you to reference something (like a word, or number, or entire sentence) without having to actually "hardcode" that word into your script each time you change it. This allows you to quickly change the value of your Variable without having to re-write your entire script. You can also store information (such as user input) for short or long periods of time.

Here's an example:

Alias MyFavoriteColor {
  set %FavColor $1-
  echo -a * Your favorite color is %FavColor
}

Alias WhatIsMyFavoriteColor {
  echo -a * As I understand it, you like %FavColor
  msg #mIRC Guess what, I like the color %FavColor
}

If you were to type /MyFavoriteColor blue, then the long-term variable %FavColor would equal blue. Anywhere you use %FavColor, the word blue would appear. That is, until you decide your new favorite color is green. wink

- Raccoon
Posted By: demitrix Re: In simple words..a variable is? - 31/08/03 05:19 AM
Krafo did u ever take algebra?
Posted By: FunChatter Re: In simple words..a variable is? - 31/08/03 09:56 AM
*No point post* [removed]

Just one question... what is the point in your post SladeKraven?
Posted By: SladeKraven Re: In simple words..a variable is? - 31/08/03 10:04 AM
What was the point in that post?
The original poster got the information he required through Raccoon.
The thread is dying.
Posted By: Krafo Re: In simple words..a variable is? - 03/09/03 01:44 AM
Thankx a lot Raccoon, your explanation was very informative and clear. Thank you.
Posted By: Raccoon Re: In simple words..a variable is? - 03/09/03 03:32 AM
You're quite welcome-- I'm glad that explaination worked for you.

If you'd like more information about variables, the different types and their uses... feel free to ask.
© mIRC Discussion Forums