Navigation: ABC Library Reference > StepRealClass >====== StepRealClass Overview ====== | |
The StepRealClass is a StepClass that handles fractional (non-integer) keys with a normal distribution (data is evenly distributed between the lowest and highest key values).
StepRealClass Concepts
The StepRealClass object applies a normal data distribution between its upper and lower boundaries. Use the SetLimit method to set the expected data distribution for the StepRealClass object.
Use the StepRealClass with non-integer numeric keys that have a normal distribution (data is evenly distributed between the lowest and highest key values).
Use the StepLongClass for integer numeric keys. Use the StepStringClass for alphanumeric keys. Use the StepCustomClass for keys with skewed distributions.
StepRealClass Relationship to Other Application Builder Classes
The BrowseClass and the ProcessClass optionally use the StepRealClass. Therefore, if your BrowseClass or ProcessClass uses the StepRealClass, your program must instantiate the StepRealClass for each use. See the Conceptual Example.
StepRealClass ABC Template Implementation
The ABC Templates (BrowseBox, Process, and Report) automatically include all the classes and generate all the code necessary to use the StepRealClass with your BrowseBoxes, Reports, and Processes.
Process and Report Procedure Templates
By default, the Process and Report templates declare a StepRealClass for fractional keys called ProgressMgr. You can use the Report Properties Classes tab (the Progress Class button) or the Process Properties General tab (the Progress Manager button) to derive from the StepRealClass instead. The templates provide the derived class so you can modify the ProgressMgr behavior on an instance-by-instance basis.
Browse Procedure and BrowseBox Control Templates
By default, the BrowseBox template declares a StepRealClass for non-integer numeric keys called BRWn::Sort#:StepClass, where n is the BrowseBox template instance number, and # is the sort order sequence (identifies the key). You can use the BrowseBox's Scroll Bar Behavior dialog–Step Class button to derive from the StepRealClass so you can modify the StepRealClass behavior on an instance-by-instance basis.
StepRealClass Source Files
The StepRealClass source code is installed by default to the Clarion \LIBSRC folder. The StepRealClass source code and its respective components are contained in:
ABBROWSE.INC | StepRealClass declarations | |
ABBROWSE.CLW | StepRealClass method definitions |
StepRealClass Conceptual Example
The following example shows a typical sequence of statements to declare, instantiate, initialize, use, and terminate a StepRealClass object and related objects. The example batch-processes a Customer file on a fractional (non-integer) key–CustomerID.
INCLUDE('ABBROWSE.INC')
INCLUDE('ABREPORT.INC')
MAP
CustomerProcess PROCEDURE
END
CustomerProcess PROCEDURE
FilesOpened BYTE
Thermometer BYTE
Process:View VIEW(Customer)
END
ProgressWindow WINDOW('Progress…'),AT(,,142,59),CENTER,TIMER(1),GRAY,DOUBLE
PROGRESS,USE(Thermometer),AT(15,15,111,12),RANGE(0,100)
STRING(),AT(0,3,141,10),USE(?UserString),CENTER
STRING(
),AT(0,30,141,10),USE(?PctText),CENTER
BUTTON('Cancel'),AT(45,42,50,15),USE(?Cancel)
END
ThisWindow CLASS(ReportManager)
Init PROCEDURE(),BYTE,PROC,VIRTUAL
Kill PROCEDURE(),BYTE,PROC,VIRTUAL
END
ThisProcess ProcessClass !declare ThisProcess object
ProgressMgr StepRealClass !declare ProgressMgr object
CODE
GlobalResponse = ThisWindow.Run()
ThisWindow.Init PROCEDURE()
ReturnValue BYTE,AUTO
CODE
SELF.Request = GlobalRequest
ReturnValue = PARENT.Init()
IF ReturnValue THEN RETURN ReturnValue.
SELF.FirstField = ?Thermometer
SELF.VCRRequest &= VCRRequest
SELF.Errors &= GlobalErrors
CLEAR(GlobalRequest)
CLEAR(GlobalResponse)
Relate:Customer.Open
FilesOpened = True
OPEN(ProgressWindow)
SELF.Opened=True
ProgressMgr.Init(ScrollSort:AllowNumeric) !initialize ProgressMgr object
! ignores inapplicable parameters
ThisProcess.Init(Process:View,Relate:Customer,?PctText,Thermometer,ProgressMgr,CUS:ID)
ThisProcess.AddSortOrder(CUS:CustomerIDKey)
SELF.Init(ThisProcess)
SELF.AddItem(?Progress:Cancel,RequestCancelled)
SELF.SetAlerts()
RETURN ReturnValue
ThisWindow.Kill PROCEDURE()
ReturnValue BYTE,AUTO
CODE
ReturnValue = PARENT.Kill()
IF ReturnValue THEN RETURN ReturnValue.
IF FilesOpened
Relate:Customer.Close
END
RETURN ReturnValue