The program:

! MExample Program 8-5

! Use a subroutine to convert all names

! in a list to uppercase.

 

DIM Name$(1 to 5)

FOR Index = 1 to 5

READ Name$(Index)

NEXT Index

CALL Capital (Name$) ! empty parentheses not needed

FOR Index = 1 to 5

PRINT Name$(Index)

NEXT Index

DATA John, Rob, Ginny, Peter, Sally

END

SUB Capital (List$()) ! empty parentheses required

! Change characters in string to uppercase.

FOR I = Lbound(List$) to Ubound(List$)

LET List$(I) = Ucase$(List$(I))

NEXT I

END SUB


The output:

JOHN

ROB

GINNY

PETER

SALLY