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   
Text File  |  2000-06-30  |  5KB  |  52 lines

  1. TURBO-LESSONS - A Pascal Tutorial        Version 1.01    Page 60
  2.  
  3.  
  4. TURBO-LESSON 13:  STRINGS
  5.  
  6. OBJECTIVES - In this lesson, you will learn about:
  7.  
  8. 1.  Strings
  9. 2.  String replacement statement
  10. 3.  Predefined string function, LENGTH
  11.  
  12.  
  13. 1.  Strings.
  14.  
  15. You have already seen some Pascal strings in the WriteLn 
  16. statements of earlier lessons.  
  17.  
  18. WriteLn('This is a string.');
  19.  
  20. It is often convenient to store strings as variables or 
  21. constants.
  22.  
  23. A string constant may be defined in the CONST section:
  24.  
  25. CONST   String_1  =  'TURBO-LESSONS';
  26.  
  27. String variables must be declared in the VAR section.  The form 
  28. of the declaration is:
  29.  
  30. VAR    First_Name : String[12];
  31.  
  32. This sets up storage for a variable named First_Name which can 
  33. store a string up to 12 characters long.   
  34.  
  35.  
  36. 2.  String replacement statement.
  37.  
  38. The replacement statement for strings is:
  39.  
  40. String_Name := (string expression);
  41.  
  42. ##### DO:
  43.  
  44. Examine PROG13.  Notice the following:
  45.  
  46. A string constant, S_Test is given the value 'Test String' in the 
  47. CONST declaration section.
  48.  
  49. Several string variables are defined in the VAR section.  
  50. î
  51. T
  52. T