!Write a function succ$ that returns the successor

!(in the ASCII table) of a character parameter.

!If the parameter string is longer than one character,

!the function returns the successor of the first character.

!Test your function using the string values "C", "z", "*", and "ABC".

 

DECLARE FUNCTION succ$

INPUT prompt "Character? ": entry$

PRINT "Successor of "; entry$[1:1];" is "; succ$(entry$[1:1])

END !main program

 

EXTERNAL function succ$(ch$)

LET ch$=ch$[1:1]

LET succ$=chr$(ord(ch$)+1)

END FUNCTION