Help

How do you put only a certain number of character in a string?

Comments

Fixed-Lenngth Strings

You can do this at the start of the program:

DECLARE STRING a$*10, b$*50

This will set the maximum length of a$ to 10 and b$ to 50
If you try to put more than those limits in, an exception will occur so you can trap it and issue an error message or perform corrective action.

If you just want to chop off a string at a certain number of characters, do this:

INPUT PROMPT "Enter a string: ": a$
PRINT "The first ten characters of a$ are: "; a$(1:10)
END