Need help with a code driving me CRAZY remove [xxxxx]
$rbkx($chr(91),$chr(93),[1] 2 [3]) returns 2
$rbkx($chr(91),$chr(93),[1] 2 ]3[) returns Error should return 2 ]3[
$rbkx($chr(91),$chr(93),[1] ]2[ ]3[) returns Error should return ]2[ ]3[
what am i doing wrong ?
Can any one help.
alias rbkx {
if ($3 == $null) return $1-
set %temp $3-
set %l 1
set %r 1
while (($1 isin %temp) && ($2 isin %temp)) {
while ($pos(%temp,$1,%l) > $pos(%temp,$2,%r)) {
inc %r
}
set %temp $left(%temp,$calc($pos(%temp,$1,%l)-1)) $+ $right(%temp, $calc($len(%temp) - $pos(%temp,$2,%r)))
}
return %temp
}
$rbkx($chr(91),$chr(93),[1] 2 [3]) returns 2
$rbkx($chr(91),$chr(93),[1] 2 ]3[) returns Error should return 2 ]3[
$rbkx($chr(91),$chr(93),[1] ]2[ ]3[) returns Error should return ]2[ ]3[
alias rbkx {
if ($3 == $null) { return $1- }
set %temp $3-
set %l 1
set %r 1
if ($1 isin %temp) && ($2 isin %temp) {
while ($pos(%temp,$1,%l) > $pos(%temp,$2,%r)) {
inc %r
}
set %temp $left(%temp,$calc($pos(%temp,$1,%l)-1)) $+ $right(%temp, $calc($len(%temp) - $pos(%temp,$2,%r)))
}
return %temp
}
Something like that?