mIRC Home    About    Download    Register    News    Help

Print Thread
#226593 08/10/10 11:29 AM
M
MRN
MRN
M
I just came over something strange.

Code:
  if (!$1-) { 
...
  } | else { echo -s blabla2 | halt }

  ; if ($1) { echo -s blabla1 | halt }


If I run that code, no echoes shows up.
If I take away the semicolon "blabla1" shows up.

If there is anything in $1-, execute commands (works).
If there is not anything in $1-, go to "else" and execute commands (doesn't works).

When I put the same statement under, but not in else-sentence, that sentence works. I have no idea why that happens.

If I could supply more info, I could say I'm using timer for this.

Just fixed another strange bug. I cannot start the same alias within an alias. I got the message that /ana.calc wasn't an alias, and that I wasn't connected to a server. I fixed that easily by creating timer.

However, this is a small bug, but I can no longer trust else statements now?

I'm using mIRC 7.1

Joined: Jan 2007
Posts: 1,155
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,155
Not bug, bad syntax.

Try this:

Code:
if (!$1-) { 
...
  }
else { echo -s blabla2 | halt }

M
MRN
MRN
M
Thanks smile

I know my syntax is bad, but it often works...

Joined: Aug 2004
Posts: 7,168
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,168
This is a good example, imo, of why scripts should not use pipes (|) to separate commands.


Link Copied to Clipboard