FANDOM


 This page explains a basic Pascal instruction. If you want to see how to make your own instructions, see Procedures and Functions.
This article is part of the Getting Started series

Like the strings, the chars are variables that contain only one character. They are declared as it follows:

a,b,c,d,e : char;

Char functionsEdit

Chars are easy to manipulate and can be altered by many functions. Note: these functions work also when manipulating separate characters in a character string.

UPCASE and LOWERCASEEdit

The upcase function turns a char that contains a low-case letter into a up-case letter. For example:

c:='a';
c2:=upcase(c); {c2 will be 'A'}

The lowercase function tunrs char that contains an up-case letter into a low-case letter.(Free Pascal)

for example;

b:='R';

b2:=lowercase(b) ; {b2 will be 'r'}

ORDEdit

The ord function returns the ASCII numeric value of the char. Remember:

  • ord('A')=65
  • ord('Z')=90
  • ord('a')=97
  • ord('z')=122
  • ord('0')=48
  • ord('9')=57

CHREdit

The chr function is the reverse of the ord function. It turns the ASCII code of the character into the character itself. Remember:

  • chr(65)='A'
  • chr(90)='Z'
  • chr(97)='a'
  • chr(122)='z'
  • chr(48)='0'
  • chr(57)='9'

See alsoEdit

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.