(args)
return s.new().from_str(s.to_str()[start:start+num])
MID$: get substring.
MID$: get substring.
MID$ : get substring .
def mid_(args):
    """MID$: get substring."""
    s, start = next(args), to_integer(next(args))
    p = pass_string(s)
    num = next(args)
    if num is not None:
        num = to_integer(num)
    list(args)
    length = s.length()
    start = start.to_integer().to_int()
    if num is None:
        num = length
    else:
        num = num.to_integer().to_int()
    error.range_check(1, 255, start)
    error.range_check(0, 255, num)
    if num == 0 or start > length:
        return s.new()
    # BASIC's indexing starts at 1, Python's at 0
    start -= 1
    return s.new().from_str(s.to_str()[start:start+num])
def mid_ ( args ) : s , start = next ( args ) , to_integer ( next ( args ) ) p = pass_string ( s ) num = next ( args ) if num is not None : num = to_integer ( num ) list ( args ) length = s . length ( ) start = start . to_integer ( ) . to_int ( ) if num is None : num = length else : num = num . to_integer ( ) . to_int ( ) error . range_check ( 1 , 255 , start ) error . range_check ( 0 , 255 , num ) if num == 0 or start > length : return s . new ( ) # BASIC's indexing starts at 1, Python's at 0 start -= 1 return s . new ( ) . from_str ( s . to_str ( ) [ start : start + num ] )