Mumpster
http://mumpster.org/

Unit 2 - Lesson 4: Expressions – ASCII Character Set
http://mumpster.org/viewtopic.php?f=29&t=804
Page 1 of 1

Author:  tlwiechmann [ Tue May 31, 2011 5:48 pm ]
Post subject:  Unit 2 - Lesson 4: Expressions – ASCII Character Set

By default, the MUMPS language is defined using the ASCII character set. Data is confined to the set as well. Some MUMPS systems let you choose UTF-8 which is a larger character set. This is important if you are going to use the system in conjunction with Web work. We are only interested in the 128 characters (decimal 0-127) that make up the ASCII set during this course.

It is important to remember that MUMPS uses the decimal numbering system when working with the characters sets. There are two MUMPS functions that work with the character sets:
  • $ASCII(string,position) – Converts the character in the string at position to a decimal number.
  • $CHAR(number[,number...] - Changes each number in the list to a character.

We will use these functions in the next lesson on Strings. The important thing to remember is that these functions let you convert back and forth between the graphical character and its internal decimal number representation.

Another feature of the character set is that it can be divided into groups. The pattern matching operator in the last lesson of this unit uses this feature to identify patterns in a string. These groupings are:

Group (Number Ranges)
Control (0-31, 127)
Punctuation (32-47, 58-64, 91-96, 123-126)
Numeric (48-57)
Alphabetic (65-90, 97-122)
Uppercase (65-90)
Lowercase (97-122)
Everything (0-127 including the null string)

Page 1 of 1 All times are UTC - 8 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/