This isn't actually "backward compatible" (whatever that means), but anyone attempting such a naming scheme should be shot unless the feature is actually there.

Back in the day, I tended to use a style such as:
Code:
var %item_ref = $+(%array[,%index,])
; (where %array[ is a variable that contains the literal text %array[)
var %item = $(%item_ref,2)


The main upside is: To change the actual item: set $+(%item_ref) ...
The main downside is: Your suggestion, as it stands, may not be compatible.

You know, the only thing I like about the mIRC scripting language is that it's fluid enough that you can actually come up with quick solutions to things like this, that use minimal amounts of code and are abstract. In fact, I've said it before: you could write an assembly parser that runs in mIRC (with many lines of code). Work with the abstraction, not against it. Make new opportunities, rather than constraints. Otherwise you risk running the mIRC scripting language into the ground.

Here is an example of "user friendly %arrays", as far as "backward compatibility" goes:
Code:
if ($FLOOD.TEXT($cid,$chan,$nick).inc >= 10) {
  ; do stuff
}


By modifying only those parts that can still be "hacked" into older versions of mIRC, you can rest assure that most newer scripts will still run on older versions, and the language stays reasonably consistent.

And the extra script for older versions:
Code:
alias FLOOD.TEXT {
  var %name = $+($1,.,$3,.,$2)
  if ($prop == inc) {
    hinc FLOOD.TEXT %name
  }
  if ($isid) {
    return $hget(FLOOD.TEXT,%name)
  }

  ; ... operators here... eg, +=, etc...
}

Last edited by s00p; 05/04/10 09:18 AM.