mIRC Homepage
Posted By: Stealth $lscriptline - 25/06/05 06:41 AM
I would like something that returns the last script line, that can be used with Goto and in aliases called by scripts. It should return the line that put you where you are now, like:
Code:
somealias {
  command
  goto next
  :next
  return $lscriptline
}

That would return 3, because the GoTo command is on line 3.

An example with callin aliases:
Code:
somealias {
  someotheralias
}

someotheralias {
  return $lscriptline
}

This would return 2, because someotheralias was called on line 2.
Posted By: DaveC Re: $lscriptline - 25/06/05 08:13 AM
I assume its ment to return the line of the last executed command.
Can you give me an idea of something we could use this type of indentifier for?
I cant think of a usefull reason for it or for the existing $scriptline identifier, (besides debugging)
Posted By: Stealth Re: $lscriptline - 25/06/05 05:42 PM
This is somewhat useful for debugging. In my script, most of my events and aliases have the :error goto thingy, and I would like to consolodate then into 1 alias to save some space in my files. I think $lscriptline would help provide a little more information than the current error handling does.
Posted By: DaveC Re: $lscriptline - 25/06/05 11:45 PM
A fair an understandable need, I have some scripts that do the same thing, I currently keep a VAR %zone value updated based on what section its in, this is only ever used in the error handler to tell me the zone something failed in, a by far inperfect solution.
© mIRC Discussion Forums