Using the Error Function
This commit is contained in:
@@ -46,14 +46,11 @@ endfun
|
||||
fun -string !mid -string &str -int &idx -int &len
|
||||
set &ans ""
|
||||
lesser $idx 0 &store
|
||||
if $store %end
|
||||
if $store %negend
|
||||
greater $len 0 &store
|
||||
if $store %loop
|
||||
return ""
|
||||
@loop
|
||||
getstrsize $str &store
|
||||
equal $store $idx &store
|
||||
if $store %end
|
||||
getstrcharat $str $idx &store
|
||||
add $ans $store &ans
|
||||
add $idx 1 &idx
|
||||
@@ -65,7 +62,8 @@ fun -string !mid -string &str -int &idx -int &len
|
||||
@return
|
||||
return $ans
|
||||
|
||||
@end
|
||||
@negend
|
||||
error "Cannot start mid at a negative index"
|
||||
endfun
|
||||
|
||||
fun -string !inBrackets -string &str -char &left -char &right -int &instance
|
||||
|
Reference in New Issue
Block a user