The problem you have is that you are forcing something upon a hashtable that isn't supposed to be. Hash table items are not sorted, nor should they be. There is a fix ofcourse, but it might be easier to just re-organize the content of your hashtable.

Code:
[color:green]; delhole: delete a hole in a numerically sorted hashtable
; usage: /delhole [table] [N][/color]

alias delhole {
  [color:green]; I need one numerical parameter and a table name ![/color]
  if (!$1) || (!$2) || ($3) { 
    echo -a [color:red]Syntax error: Alias delhole accepts exactly two arguments, and not $0 $+ .[/color]
    echo -a [color:red]Correct usage: /delhole table N[/color] 
  }
  elseif (!hget($1)) { 
    echo -a [color:red]Syntax error: The supplied hash table does not exist.[/color] 
  }
  elseif ($2 !isnum) { 
    echo -a [color:red]Syntax error: Argument 2 must be a number representing the hole in the table.[/color] 
  }
  else {
    [color:green]; set start and end of loop[/color]
    var %i = $2,%j = $hmatch($1,*,0)
    [color:green]; start loop[/color]
    while (%i <= %j) {
      hadd $1 %i $hget($1,$calc(%i + 1))
      inc %i
    }
    [color:green]; delete final entry[/color]
    hdel $1 $calc(%j + 1)
    echo -a [color:blue]sequence complete[/color]
  }
}        


But as said -- this is an extremely ineffecient way of using hashtables.


DALnet #Helpdesk
I hear and I forget. I see and I remember. I do and I understand. -Confucius