Actor, we're just going to have to know the contents of "str" before the function returns.
See my snippet above.
EDIT: Oh.. and if it's choking BEFORE it returns, put the ShowMessage call before the parsing statement in get_int.
Like
Code:
until ch = COMMA ;
ShowMessage(str);
val(str, i, err) ;
if err = 0 then
get_int := i
else
get_int := 0