What's new in EGL version 6.0
Note: If you used an earlier version of EGL to create a Web application that is based on JavaServer Faces, do as follows in the workbench:
- Click Help > Rational Help
- In the Search text box of the help system, type at least the initial characters in this string: Migrating JavaServer Faces resources in a Web project
- Click GO
- Click Migrating JavaServer Faces resources in a Web project and follow the directions in that topic
Version 6.0 increases the power of the EGL language:
- Processing of relational databases has improved--
- New wizards let you quickly do as follows:
- Create data parts directly from relational database tables
- Create Web applications that create, read, update, and delete table rows from such tables
- New system functions are available:
- sysLib.loadTable loads information from a file and inserts it into a relational database table.
- sysLib.unloadTable unloads information from a relational database table and inserts it into a file.
- If you are generating Java code, you can access SQL database rows in a cursor by navigating to the next row (as was always true); by navigating to the first, last, previous, or current row; or by specifying an absolute or relative position in the cursor.
- The forEach statement allows you to loop easily through the rows of an SQL result set.
- The freeSQL statement frees any resources associated with a dynamically prepared SQL statement, closing any open cursor associated with that SQL statement.
- String processing has improved--
- You can specify substrings in a text expression, as in the following example:
myItem01 = "1234567890"; // myItem02 = "567" myItem02 = myItem01[5:7];- You can specify a back space, form feed, or tab in a text literal
- You can compare strings against either of two pattern types:
- An SQL-type pattern, which includes the LIKE keyword. An example is as follows:
// variable myVar01 is the string expression // whose contents will be compared to a like criterion myVar01 = "abcdef"; // the next logical expression evaluates to "true" if (myVar01 like "a_c%") ; end- A regular-expression pattern. An example is as follows:
// variable myVar01 is the string expression // whose contents will be compared to a match criterion myVar01 = "abcdef"; // the next logical expression evaluates to "true" if (myVar01 matches "a?c*") ; end
- You can use these text-formatting system functions:
- strLib.characterAsInt
- Converts a character string into an integer string
- strLib.clip
- Deletes trailing blank spaces and nulls from the end of returned character strings
- strLib.formatNumber
- Returns a number as a formatted string
- strLib.integerAsChar
- Converts an integer string into a character string
- strLib.lowercase
- Converts all uppercase values in a character string to lowercase values
- strLib.spaces
- Returns a string of a specified length.
- strLib.upperCase
- Converts all lowercase values in a character string to uppercase values.
- You can declare variables and structure items of new types.
The new numeric types are as follows--
- FLOAT
- Concerns an 8-byte area that stores a double-precision floating-point numbers with as many as 16 significant digits
- MONEY
- Concerns a currency amount that is stored as a fixed-point decimal number up to as many as 32 significant digits
- SMALLFLOAT
- Concerns a 4-byte area that stores a single-precision floating-point number with as many as 8 significant digits
The new datetime types are as follows--
- DATE
- Concerns a specific calendar date, as represented in 8 single-byte digits
- INTERVAL
- Concerns a span of time that is represented in 1 to 21 single-byte digits and is associated with a mask such as "hhmmss" for hours, minutes, and seconds
- TIME
- Concerns an instance in time, as represented in 6 single-byte digits
- TIMESTAMP
- Concerns an instance in time that is represented in 1 to 20 single-byte digits and is associated with a mask such as "yyyymmddhh" for year, month, day, and hour
- The syntax provides additional options--
- You could always reference an element of a structure-item array as follows:
mySuperItem.mySubItem.mySubmostItem[4,3,1]The following references are now valid, too--mySuperItem[4].mySubItem[3].mySubmostItem[1] mySuperItem.mySubItem[4,3].mySubmostItem[1] mySuperItem.mySubItem.mySubmostItem[4][3][1] mySuperItem.mySubItem[4][3].mySubmostItem[1]- You can use a comma-delineated list of identifiers when you declare parameters, use-statement entries, set-statement entries, or variables, as in this example:
myVariable01, myVariable02 myPart;- In a numeric expression, you can now specify an exponent by preceding a value with a double asterisk (**), so that (for example) 8 cubed is 8**3
- You can now specify expressions that each resolve to a date, time, timestamp, or interval; and date arithmetic lets you do various tasks such as calculating the number of minutes between two dates
- The following additions also allow for date and time processing:
- sysVar.currentTime and sysVar.currentTimeStamp are system variables that reflect the current time
- New formatting functions are available for dates (sysLib.formatDate), times (sysLib.formatTime), and timestamps (sysLib.TimeStamp)
- Each of the following functions let you convert a series of characters to an item of a datetime type so that the item can be used in a datetime expression:
- sysLib.dateValue returns a date
- sysLib.timeValue returns a time
- sysLib.timeStampValue returns a timestamp associated with a particular mask such as "yyyymmdd"
- sysLib.intervalValue returns an interval associated with a particular mask such as "yyyymmdd"
- sysLib.extendDateTimeValue accepts a date, time, or timestamp and extends it to an item associated with a particular mask such as "yyyymmddmmss"
- You can use these new, general statements:
- The for statement includes a statement block that runs in a loop for as many times as a test evaluates to true. The test is conducted at the beginning of the loop and indicates whether the value of a counter is within a specified range.
- The continue statement transfers control to the end of a for, forEach, or while statement that itself contains the continue statement. Execution of the containing statement continues or ends depending on the logical test that is conducted at the start of the containing statement.
- You can run a system command synchronously (by issuing the function sysLib.callCmd) or asynchronously (by issuing the function sysLib.startCmd).
- You can use two new functions that let you access command-line arguments in a loop
- sysLib.callCmdLineArgCount returns the number of arguments
- sysLib.callCmdLineArg returns the argument that resides in a specified position in the list of arguments
- You can now specify a case statement in which each clause is associated with a different logical expression. If you use this new syntax, the EGL run time executes the statements that are associated with the first true expression:
case when (myVar01 = myVar02) conclusion = "okay"; when (myVar01 = myVar03) conclusion = "need to investigate"; otherwise conclusion = "not okay"; end- You can control whether a function parameter is used only for input, only for output, or for both; and you can avoid the choice by accepting the default setting, which is the unrestricted "for both".
- You can now specify a datetime, text, or numeric expression that is more complex than a single item or constant, in these cases:
- When you specify the value that is provided to the operating system by a return statement
- When you specify an argument that is passed in either a function invocation or a program call; however, the characteristics of the receiving parameter must be known at generation time
- You can now specify a complex numeric expression when exiting from the program
The development environment has improved as well:
- Two new features give you the ability to access parts quickly, even as your code grows in complexity--
- The Parts Reference view lets you display a hierarchical list of the EGL parts that are referenced by a program, library, or page handler; and from that list, you can access any of the referenced parts
- The EGL search mechanism lets you specify a search criterion to access a set of parts or variables in your workspace or in a subset of your projects
- Finally, the EGL Web perspective has been eliminated in favor of the widely used Web perspective.