<<Cheats >>

Home Page

Projects...
PC Controller Box
Joystick Switch Box
c128D Refurb

Programs...
Byte Simulator
Cheat 'O Matic
GEOS

Collections...
3D Models
Book Collection

Information...
My BASIC Notes
Web Links

eMail Me

Note: You must add uk to the end of the address, it's to help prevent spam.

My BASIC Notes

Basic2 Commands
Disk Drives
ASCII and CHR$ Codes
PEEK's and POKE's
RAM Memory Map
ROM Memory Map
Screen Display
Sprite

MID$
Abbreviation: M <SHIFT+I>

TYPE: String Function
FORMAT: MID$(<string>,<numeric-1>[,<numeric-2>])

Action: The MID$ function returns a sub-string which is taken from within a larger <string> argument. The starting position of the substring is defined by the <numeric-1> argument and the length of the sub-string by the <numeric-2> argument. Both of the numeric arguments can have values ranging from 0 to 255.

If the <numeric-1> value is greater than the length of the <string>, or if the <numeric-2> value is zero, then MID$ gives a null string value. If the <numeric-2> argument is left out, then the computer will assume that a length of the rest of the string is to be used. And if the source string has fewer characters than <numeric-2>, from the starting position to the end of the string argument, then the whole rest of the string is used.

EXAMPLE of MID$ Function:

10 A$="GOOD"
20 B$="MORNING EVENING AFTERNOON"
30 PRINT A$ + MID$(B$,8,8)

GOOD EVENING


Commodore Cheetah made by Allen Monks, started in the year 2000.