home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
ENTERPRS
/
CPM
/
UTILS
/
S
/
TPTUTOR2.ARC
/
TL13.TXT
< prev
Wrap
Text File
|
2000-06-30
|
5KB
|
52 lines
TURBO-LESSONS - A Pascal Tutorial Version 1.01 Page 60
TURBO-LESSON 13: STRINGS
OBJECTIVES - In this lesson, you will learn about:
1. Strings
2. String replacement statement
3. Predefined string function, LENGTH
1. Strings.
You have already seen some Pascal strings in the WriteLn
statements of earlier lessons.
WriteLn('This is a string.');
It is often convenient to store strings as variables or
constants.
A string constant may be defined in the CONST section:
CONST String_1 = 'TURBO-LESSONS';
String variables must be declared in the VAR section. The form
of the declaration is:
VAR First_Name : String[12];
This sets up storage for a variable named First_Name which can
store a string up to 12 characters long.
2. String replacement statement.
The replacement statement for strings is:
String_Name := (string expression);
##### DO:
Examine PROG13. Notice the following:
A string constant, S_Test is given the value 'Test String' in the
CONST declaration section.
Several string variables are defined in the VAR section.
î
T
T