Pascal ASCII and text Conversion

Source: Internet
Author: User
This is a small program that helps beginners understand ASCII codes, character-type and integer types.

For example, enter I love you

Print 73 32 108 111 118 101 32 121 111 117 13 10

Program transpro (input, output );
VaR
Judge, Number: integer;
Letter: Char;
Begin
Writeln ('this software was produced by chaobs! ');
Writeln ('you can use this soft ');
Writeln ('to translate numbers into letters or to translate to nuambers! ');
Writeln ('Press 1 to transplate numbers and 2 to transplate letters ');
Read (judge );
If Judge = 1
Then
Begin
Repeat
Read (number );
Letter: = CHR (number );
Write (letter );
Until number = 33;
Readln;
End;
If Judge = 2
Then
Begin
Repeat
Read (letter );
Number: = ord (letter );
Write (number ,'');
Until letter = '! ';
Readln;
End;
Writeln ('If you foud something wrong with my program please call chaobs! ');
Readln;
End.

The improvement of this program can be changed to the Caesar encryption method or the stream encryption method. I have used this method to implement a stream encryption program. Please refer to the Delphi/Lazarus section.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.