mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Dec 2002
Posts: 18
Krafo Offline OP
Pikka bird
OP Offline
Pikka bird
Joined: Dec 2002
Posts: 18
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.

Joined: Feb 2003
Posts: 2,812
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,812
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


Well. At least I won lunch.
Good philosophy, see good in bad, I like!
Joined: Jun 2003
Posts: 67
D
Babel fish
Offline
Babel fish
D
Joined: Jun 2003
Posts: 67
Krafo did u ever take algebra?


while (demi == nub) {
inc %skill
}
Joined: Dec 2002
Posts: 339
F
Fjord artisan
Offline
Fjord artisan
F
Joined: Dec 2002
Posts: 339
*No point post* [removed]

Just one question... what is the point in your post SladeKraven?

Last edited by FunChatter; 31/08/03 10:17 AM.
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
What was the point in that post?
The original poster got the information he required through Raccoon.
The thread is dying.

Joined: Dec 2002
Posts: 18
Krafo Offline OP
Pikka bird
OP Offline
Pikka bird
Joined: Dec 2002
Posts: 18
Thankx a lot Raccoon, your explanation was very informative and clear. Thank you.

Joined: Feb 2003
Posts: 2,812
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,812
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.


Well. At least I won lunch.
Good philosophy, see good in bad, I like!

Link Copied to Clipboard