Tutorial by Examples

Generally you should always define all variable and parameters as NO-UNDO unless you really need to. DEFINE VARIABLE cString AS CHARACTER NO-UNDO. cString = "HELLO". DISPLAY cString.
Using the + operator you can easily concatenate two or more strings. DEFINE VARIABLE cString AS CHARACTER NO-UNDO. cString = "HELLO". cString = cString + " " + "GOODBYE". DISPLAY cString FORMAT "X(20)".
There are a couple of useful built in functions for working with string. All functions working with the position of characters start with index 1 as the first character, not 0 as is common in many languages. STRING - converts any value to a string This example converts the integer 2000 to the stri...
All strings in Progress ABL are case sensitive unless specified otherwise. This example will display a message box saying that the strings are identical. DEFINE VARIABLE str1 AS CHARACTER NO-UNDO. DEFINE VARIABLE str2 AS CHARACTER NO-UNDO. str1 = "abc". str2 = "ABC". ...
BEGINS - returns TRUE if one string begins with another string. string1 BEGINS string2 If string1 BEGINS with (or is equal to) string2 this will return true. Otherwise it will return false. If string two is empty ("") it will always return true. BEGINS is very useful in queries wher...
As mentioned before strings are normally case insensitive but that only regards comparison of strings. There's built in functions for changing case. CAPS (string) Makes string upper case LC(string) Makes string lower case DEFINE VARIABLE c AS CHARACTER NO-UNDO. DEFINE VARIABLE d AS C...
There are a number of functions and methods for working with comma (or other character) separated lists in Progress 4GL. NUM-ENTRIES Returns the number of entries in a list. You can optionally specify delimiter, comma is default NUM-ENTRIES(string [, delimiter]) Using comma, the default deli...
In Progress 4GL the normal way to write a special character is to preceed it with a tilde character (~). These are the default special characters SequenceInterpreted asComment~""Used to write " inside strings defined using "string".~''Used to write ' inside strings defined...

Page 1 of 1