ASNA Visual RPG® 4.0 Classic

Click here to view the release notes for Acceler8DB 5.0


Contents  

New Features 

SQL Server Support 

Examples 

Examples Database 

Deployment Tools 

Bug Fixes (Up to Build 11.435) 

Assigning AVR Controls in AVR

Restrictions 

Final Note on Passing Controls

 

 

New Features in AVR 4.0:

AVR Release 4.0 contains many new features. The following is a quick listing of the main new features available in this release. Refer to the "What's New?" page within the Getting Started book for a listing of the new features, or refer to the Whats New? book in the AVR help file for a categorized listing of all the new features and enhancements included in AVR Release 4.0.

 

New Features:

§  CALL/PARM to iSeries/400 now supports Arrays, multiple occurrence data structures and *TIME, *DATE & *TIMESTAMP in the parameter list.  If you use CALL/PARM in any way to the iSeries/400 from an AVR 4.0 application, you must install and use DataGate for iSeries/400 Version 5.0.

§  IDE Enhancements

}   Colorized code in Free Format editor

}   Default Project Settings

}   Tip of the Day

}   Binary compatibility option removed

§  Network Blocking for Output Files

§  Null Fields

§  Setting File cursor to Start or End of file

§  SQL Server Support

§  Transaction Processing

§  Unicode Data Type

§  Variable Length Support

 

New Op Codes:

§  DELETERANGE

§  ENDTPM

§  READRANGE

§  SETRANGE

§  STARTTPM

 

New Properties:

§  CellValue

§  ProcessID

§  Stretch - supports retain aspect ratio setting

 

New Built-In Functions:

§  %NULLIND

§  %LEN

 

New Figurative Constants:

§  *START (SETLL and SETGT)

§  *END (SETLL and SETGT)

 

New Help Format:

§  .CHM Files

 

Changes to Op Codes:

§  CHAIN (Use ReadRange)

§  DCLDISKFILE (Random Keyword)

§  DCLFLD (Varying Keyword)

§  DCLPARM (DBDirection Keyword)

§  READRAND (Use ReadRange)

§  SETGT (*Start and *End)

§  SETLL (*Start and *End)

 

Changes to Properties:

§  Stretch

Back To Top

 

SQL Server Support

In order to optimize SQL Server processing and to enhance client/server performance with all supported database engines (iSeries/400, Acceler8DB and SQL Server) with dynamic Network Blocking, AVR 4.0 introduces three new commands:

SETRANGE - Positions the file to the desired range of records constrained by the FirstKey and the LastKey parameters.  Use SetRange Read(P) loop instead of SETLT/SETGT Read(P)E loop.

READRANGE Begins reading from the file at the desired range of records constrained by the FirstKey and the LastKey parameters.  Use ReadRange Read(P) loop instead of Chain Read(P)E loop.

DELETERANGE Positions the file to the desired range of records constrained by the FirstKey and the LastKey parameters and deletes those records.  Replaces Read(PE) Delete loop.

There are important considerations when converting existing AVR applications to support SQL Server databases.   For a complete listing, see Visual RPG Programming Considerations.  

For a listing of important SQL Server Issues and Requirements, see Differences between Acceler8DB, DataGate for DB2/400 (DG400) and DataGate for SQL Server (DSS)

For a listing of important issues and instructions to port your AVR applications to DSS, see Porting AVR to DSS.

Back To Top

Examples:

§      New examples have been included, and some existing examples have been revised.  The example programs are located within the \Program Files\ASNA\Examples\AVR40 folder.  All fixed format (RPG/400) projects are now available as Free Format projects, as well.

§        Examples 40.doc is located in the \Examples\AVR40 folder and provides a listing and description of all example programs included with this release.  This document is also included within the AVR help file. Click on the Example Programs book included with AVR to view the document on-line.§

Back To Top 

Examples Database:

§         ASNA Local DB has been modified where the examples files have been moved from the root library to a new library called ASNA_Example_Files.  This library is also set as the User Default in the library list for this database.  

With DataGate for SQL Server (DSS), you can copy this library to a SQL Server 2000 database from the Acceler8DB Database Manager.

Back To Top 

Deployment Tools:

This release contains Deployment documentation for InstallShield Developer 7.  Sample wizards are also included to get you started with deployment of your AVR 4.0 projects including automatic component registration. Look in \Program Files\Asna\Examples\AVR40\Deployment for more information.

Back To Top

Bug Fixes Included in AVR 4.0:   (Up to Build 11.435)

·         Case 389: Given an AVR 4.0 project that consumed an AVR-generated OCX with a design-time property having a default property of True. If you then changed the OCX in the consuming app to False, then recompile the OCX, the consuming app's property would get reset back to the default.

·         Case 169: Fixed bug where the IDE would crash when adding the ComponentOne True OLE DB Dropdown control to a form.

·         Fixed tool tip window (background image was too small).

·         Case 205: Fixed bug where the FarPoint ListPro was firing the LostFocus event when the drop down arrow is clicked.

·         Case 293: From the IDE, a "Database not found" error was being encountered when importing a display file from a *PUBLIC database (we weren't correctly handling the *PUBLIC prefix)

·         Case 283: Using ReadRange with LastKey(*hival) did not work on SQL Server. In reality this usage is same as SETLL and READ, and doesn't apply to ReadRange. Internally, we now treat ReadRange with LastKey(*hival) as SETLL and READ

·          Case 278: An application would lock up after showing a form thousands of times. Resolved: Assigning *nothing to a form's icon was leaking GDI objects.

Bug Fixes Included in AVR 4.0:   (Up to Build 11.425)

·         Runtime would crash when hundreds of forms were loaded.

·         Introduced EOF synonymous keyword for NOTFND in READRANGE command.

·         CLEAR formname.Subfilename did not clear the subfile.   This deprecates subfile.clear = *true, which will be dropped in a future release. 

·         MDI child's Left and Top properties were not being used correctly at runtime.

·         IDEs format align menu options were enabled even if no controls were selected.

·         Compiler was reporting an error with valid Null fields in External DataStructures.

·         READRANGE was not resetting %EOF(<filename>).

·         IDE: Format Align command would crash IDE if no control on form was selected.

·         IDE: Changed default editor font to Courier New.

·         AVR: LOOKUP was not finding entry on LO lookup when argument was greater than the last array element.

·         IDE: File version was not being auto-incremented correctly if the project wasn't saved.

·         AVR: Setting Time & Timestamp fields to *HIVAL would fail with "Invalid Data".

·         AVR: MDI menus were appearing as enabled even though they were disabled.

·         AVR: Clearing a multidimensional DS was clearing only the first dimension. It now clears the whole DS.

·         AVR: MOVE on Unicode data was not moving to the Right.

·         AVR: (Compiler) Multiformat files with duplicate format IDs would crash the IDE.

·         AVR: When fieldAdvance property = true and have an editcode allowing commas; entering a comma to separate thousands and then press "-" to indicate a negative value would result in a positive number.

·         AVR: When passing a multi-occurrence data structure to AS/400 program after an OCCUR is executed, the corresponding DS occurrence was trashed.

·         AVR: EVAL was not trapping object creation errors.

·         AVR: CALL PARM to an AVR program in the project would only pass the current occurrence from DS.  It now passes the entire data structure.

·         AVR: Referencing Zoned property or Zoned method parameter of a dll caused "Unknown exception error" (introduced in 11.393).

·         AVR: Assignment of a non-unicode string to Unicode and Unicode to Unicode was implemented as a MOVE rather than MOVEL. 

·         AVR: MOVEARR was not working correctly with Unicode data type.

·         AVR: Comparison of Unicode fields with unequal length was not correct.

·         AVR: Scan would not find a string of numbers correctly.

·         AVR: Added additional error trapping to LOADPICTURE.

 

Bug Fixes Included in AVR 4.0:   (Up to Build 11.394)

·        MDI parent menus could disappear when Maximizing and Minimizing child forms.

·        AVR help window would be closed along with the form if it was created by pressing F1 on the form. 

·        AVR was unable to set an SQL Bit field (*boolean) to False.

·        Improved AVR processing of Unicode data types:  Use of Unicode within KeyList and SETLL would raise compiler error.  Internal error was incorrectly being raised when trying to add/update data into a Unicode field.

Bug Fixes Included in AVR 4.0:   (Up to Build 11.372)

·         Arrays of type *Boolean were not correctly evaluating to True/False.  (Arrays of type *IND were not affected, and have always worked correctly).

·         Float to Decimal to Float conversion would lose precision.  Conversion was corrected to retain precision.

·         Compiler was not picking up Event information for certain classes (e.g., PowerPoint.Application).

·         Subfile.Clear = *False (*OFF) no longer will clear the subfile.  Only Subfile.Clear = *True (*ON).

·         Fixed "Library not found" on a case-sensitive SQL-Server instance.

·         Fixed more memory leaks in Call Pgm.

·         The Top event of a Subfile did not correctly fire when all records were visible.

·         Added *MAP to CHKFMTID.  *NO option now means NO, rather than MAP.

·         Coding a Dcfld with Varying(*Yes) and not specifying a Len parameter would crash the compiler.

·         AVR IDE would crash when compiling against certain SQL tables.

·         Show Form in AVR IDE would crash with Infragistic controls.        

·         AVR would leak memory when opening and closing database files in COM+.

·         Late bound by reference arguments were not getting passed back to caller.

·         Unexpected exception was being raised when loading large string from TXText 3rd party control.

·         UserControl's Indicator properties were not being read back correctly from property bag after being persisted into a form.

·         Decimal positions of a large number ( > 21,9 ) were being lost after a DIV (or /) operation.

·         Fixed locale-specific VT_DECIMAL conversions. It was not taking the locale into consideration so AVR was either losing the decimals (when converting from string into a VT_DECIMAL) or ignoring the decimal separator (when converting from numeric to VT_DECIMAL).

·         Fixed "Stack operation error" on Unicode Varying Keys on SetLL.

·         Added Random keyword to dclDiskFile to facilitate QRYFILE that produce new key set.

·         Set up rules for interpreting command line arguments in dclPlist Name( *entry ) to correctly handle backslash character contained in the argument.

·         Some array-to-array arithmetic operations could lose high order precision.

·         *App.GetMsgText was not retrieving messages if being run in COM+.

·         *App.GetMsgText was leaking memory on each execution.

·         The IDE was not surfacing TabIndex and TabStop properties for alignable controls (such as Calendar Widgets).

·         An invisible ioField would become visible when setting its READONLY property.

·         IDE would crash when properties were being written into a property bag if the property value was a controls IDispatch.

·         %Error was incorrectly being reset when it was assigned to a variable.

·         Compiler was crashing on a syntax error on dclDiskfile (e.g., continuation symbol missing).

·         DIV operation with Roundup for numbers having 9 decimals was producing incorrect results.

·         READ following SetRange when nothing found was not returning EOF.

·        SETLL Key(*End) was seeking to last record in file instead of beyond last record.

 

Bug Fixes Included in AVR 4.0:   (Up to Build 11.320)

·         When getting the value (default) property of an object AVR runtime would leak the object (memory leak) because it was not being released. As an example, myVar = ExcelWorkSheet.Cells[row, col], would leak memory in the AVR applications process in addition to the Excel.exe process.

·         Using CLEAR to initialize a variable of *String data type would leak memory.

·         Using CLEAR to initialize variables of *Boolean and *Variant data types did nothing.

·         If a Variant was empty such as a non-existent Collection Item or empty Excel Cell, its assignment to an AVR variable did not change the variable.  As an example, in the statement:

                        myVar = ExcelWorkSheet.Cells[row, col]

                        myvar would not be changed if the referenced Cell was empty.

·         AVR was producing an "Unknown Exception" error when passing a Character or String parameter by reference to a class function.  No error occurred when passed by value.

·         SubStr command used with an invalid SubLen value was misreporting the error as "Out of Memory".

·         Using QRYFILE against non-indexed file now correctly allows for QryKeyFlds when Random (*NO) and ORG (*indexed).

·         SetRange was throwing a runtime exception if the key was not found.

·         Importing a Display File containing a  Subfile with numeric fields would crash when the form was Shown.

·         I/O operations on a multiformat file, such as READE & READPE, were returning incorrect results when using the Filename instead of the Format name in the command.

·         Apply button was not being enabled when version information keys were changed on the Project Setting > Version dialogs.

·         AVR now supports *Varying for *Unicode Type.

·         Display File Import was broken in AVR 4.0 where it would crash or cause a CPF error .

·         FormGen now allows Replace All when creating a new project.

·         Using select method in the Gotfocus event of a Subfile would erase data in the active cell of the Subfile.

·         When a VRF or VRX was maintained in Text mode, the IDE would mishandle child controls in any Container control array, such as Tab Controls, Frames, etc.  Controls in 1 through n elements of a control array were being placed in the 0 element.

·         Some IDE dialogs were too small for long error messages.

·         Boolean and Unicode data type support has been added to FormGen 4.0.

·         AVR applications could randomly crash or receive Unhandled Exception runtime errors when AVR Controls were assigned to Object variables.  See Assigning AVR Controls in AVR (below) for additional details.

·         FormGen 4.0 was not correctly handling Variable length fields and Null Capable fields.   

·         FormGen 4.0 was not correctly processing integer data types.

·         IO Commands employing Access(*NoLock) were locking the record anyway.

·         The Subfile Col property was being set incorrectly to the last column requiring an EditCode or EditWord.

·         %EOF not being set correctly for the READE operation.

·         FormGen 4.0 was not correctly processing integer data types

·         Chain with Access(*NoLock) was incorrectly locking the record.

·         Subfile Col property was being incorrectly set to the last column where an EditCode or EditWord was used.

·         %EOF was not being set correctly in a Do loop where READE & DELETE were executed on the same file.

·         When a parameter to a remote program is an Integer, it is now passed as Integer type and not Binary.

·         A '*' in edit words was behaving as a zero suppressed character and giving '0's instead of spaces.

·         Status bar was being marked as dirty when it is aligned to a form.  Now, alignable controls are only marked as dirty if its Align property is set to none.

·         Editor was always saving to temp when closing a dirty program, even if the user had said no.

·         Free Format editor was randomly inserting blank lines into source code.

·         When browsing for TLB (Type Library) files from the References dialog, the TLB was not being referenced correctly.

·         MOVE was not working for objects, e.g. MOVE imgCancel.Picture btncancel.Picture.

·         Changing the editor font wasnt taking effect for a program that was opened as File (rather than a member of the Project).

·         The number of spaces used when tabbing in Free Format editor was always 4, regardless of IDE setting.

·         LOOKUP of an array of type *string was causing Unhandled Exception runtime error.

·         When BASESTR of XLATE command was an ioField and Value property was not given, the command was assuming the ioFields iDispatch instead of value property.

·         An MDI menu could produce the wrong menu Click event when an MDI child form was present.

·         Correct TLB type info was not making it to the compiler causing incorrect compiler errors. AVR users should now be able to compile against TLBs and run against the corresponding DLLs.

·         Varying Unicode fields were not being handled correctly in AVR. 

·         Subfile selection handling and painting was not working correctly.

Back To Top 

Assigning AVR Controls in AVR

A longtime bug was fixed in AVR 4.0 11.283 that caused applications to spuriously encounter Unhandled Exceptions or even crashing in Windows. 

The cause of the crashing was in the corruption of memory that occurred when a form was closed where one or more of its controls had been assigned to an object variable.  During the destruction process of the form, the controls were being destroyed in the incorrect order relative to the object references. 

The following code illustrates the usage that could precipitate the bug prior to build 11.283:

 Dclfld myControl       Type( *object )
 myControl = ioField1          // get ioField1 IDispatch (assignment)

 OR

 mySubr ( ioField1 )          
.        
.
 BegSR    mySubr
 dclSRParm myCtl  Type( *object )  By( *Value ) // (assignment)
    myCtl.Setfocus ( )
 EndSR 

Back To Top 

Restrictions

There are no restrictions to the assignment of Controls to object variables as long as the object variables are defined in the same form program (VRF or VRX) that contains the controls.

If, however, the target object variables are outside the form, these object references must be released before the form is destroyed.  Outside the form means another form (VRF or VRX); a program (VRP); or a class (VRC).

For example, assume the above subroutine was coded in the projects startup program, and that it is being executed from various forms in the application.  Before exiting the subroutine, you must release the object by setting it to nothing prior to returning.

 BegSR    mySubr
 dclSRParm myCtl  Type( *object )  By( *Value )     (assignment)
   
myCtl.Setfocus ( ) 
    myCtl = *Nothing                  // Release the object            
 EndSR

 

In a Class (VRC), the rules are the same:

 BegSR    mySubr        Scope( *Public )
 dclSRParm myCtl  Type( *object )  By( *Value)  (assignment)
   
myCtl.Setfocus ( ) 
    myCtl = *Nothing                  // Release the object            
 EndSR

 

In a Procedural program that returns without setting on *INLR, the rules are the same:

 dclPlist *entry
    dclParm  myCtl   Type( *variant ) // (assignment)
    myCtl.Setfocus ( ) 
    myCtl = *Nothing                  // Release the object            
    Return                            // return to CALLer

Back To Top 

Final Note on Passing Controls as Parameters:

  Never pass controls by Reference. 
  Always pass controls by Value (default).
 

OK:

 dclSRParm myCtl *object   By (*value)      
 dclSRParm myCtl *object             

 

Not OK:

 dclSRParm myCtl *object   By (*reference)

Back To Top

 

   02/01/2011          © 2007. Amalgamated Software of North America. All rights reserved.