The Rexx built-in functions are the simplest functions to use because the functions themselves already exist. All you have to do is to call them in your programs. Rexx supplies about 60 to 70 built-in functions, depending upon the implementation. They're broken down into various types or into various categories. Let's start by looking at some of the string manipulation functions. About half of the built-in functions in Rexx are string manipulation functions. There are character oriented functions and there are ward oriented functions. Most of the word oriented functions have word somewhere in the function name. Remember that in Rexx the term word means blank delimited text. A lot of functions have both required and optional arguments. The optional arguments typically have default values assigned if you don't code the argument. These defaults usually makes sense. For example, pad characters in functions always defaults to blanks. There are functions to count the number of characters in a string or truncate strings or to break strings apart, intersections, there are functions to search strings for matching patterns or to edit or translate strings in some way. There's just a bunch of functions. The Parse instruction, which we introduced a bit earlier, also has very strong string manipulation capabilities. Many of those things you can do with functions, you can do with Parse. You select the method that works best for you given the programming situation. Here are some built in string manipulation functions. They can be used to extract data from strings, add data to strings, find data in strings, and so forth. Now, don't worry, I'm not going to go into the gory details of all of these functions. If I did, we'd be discussing functions for the rest of the week and when we were done you probably wouldn't remember any of it anyway. Instead, we'll discuss one function in detail, and that's the substring function. The substr function, pronounce sub string, returns a portion of an input character string. The first argument is the input string to be divided. The second argument is a number, which is the character position in the input stream where the division has to occur. The third and fourth arguments are optional. The default for sub string is to return the rest of the input string back to the caller, but if you use the third argument, it sets the number of characters sub string is to return to caller. If this numbering seeds the number of characters remaining in the input string, the return string is padded with the pad character, which is the fourth argument. The default pad character is a blank. The first of the three examples returns everything from the third position onwards, so 'c d e f g', the second example returns everything from the third position onward for a total of four characters, so 'c e d f', and the last example starts in position three, returns seven characters, and uses exclamation points for blanks, so we get 'c d e f g!! '. There are functions to test the type of data and to compare one stream to another. There are two ways to use the datatype function by supplying one argument and by supplying two. With only one argument, datatype will test the data included in the argument and return either the stringnum if the data is valid Rexx number or char if it's not a number. If two arguments are specified, then the second argument specifies a particular type of data. If the first argument is indeed the type of data defined by the second argument, then datatype returns a one indicating true, otherwise it returns a 0 indicating false. The center function will center a string within a field and fun fact, you can spell center in US English or in the proper Queen's English. To make multiple copies of a string use copies, to format and round the number use format, to add or delete spaces and other characters between words use space, to remove leading or trailing character from a string use strip. Conversion functions are very useful when you're trying to deal with hexadecimal or binary values in Rexx. You can convert in any direction between character hexadecimal and decimal values. You can also convert between hexadecimal and binary values. The chart here on the visual shows the character a along with its hexadecimal decimal and binary equivalence and the conversions functions that are used to convert between these different formats. The binary functions manipulate data at the bit level. They'll perform Boolean and or exclusive OR operations against binary strings. The numeric functions deal with numbers. The Abs function returns the absolute value of a number. The min and max functions take up to 20 input numeric values and return the smallest or largest of those values respectively. The digits, form, and fuzz functions accept no arguments. They return the current numeric digits, form, and fuzz settings according to the numeric instruction. The random function returns a pseudo-random number within a range that you can specify. If you don't specify the beginning or end of the range as the first two arguments to random, the default range is one to 999. The final built-in function category we'll look at is informational functions. Both date and time accept a variety of arguments to return the current date and time in many different formats. The second set of functions on the visual SYSVAR and MVSVAR, SYSCPUS, TSOE, external functions, not built-in Rexx Functions and as such they're not available in all implementations of Rexx, but neither is user ID for that matter. The diagnostic functions source line condition and Error text will be discussed in greater detail when we talk about error handling. The line size function will return the width of the terminal screen minus one character. In other words, this is the number of characters that will fit on one line of the screen with the same instruction. All right. Enough about built-in functions. In the next video, we'll turn our attention to subroutines.