Navigation: ABC Library Reference > StepLongClass >====== StepLongClass Overview ====== | |
The StepLongClass is a StepClass that handles integer keys with a normal distribution (data is evenly distributed between the lowest and highest key values).
StepLongClass Concepts
The StepLongClass object applies a normal data distribution between its upper and lower boundaries. Use the SetLimit method to set the expected data distribution for the StepLongClass object.
Use the StepLongClass with integer keys that have a normal distribution (data is evenly distributed between the lowest and highest key values).
Use the StepCustomClass for integer keys with other skews. Use the StepRealClass for non-integer numeric keys. Use the StepStringClass for alphanumeric keys.
StepLongClass Relationship to Other Application Builder Classes
The BrowseClass and the ProcessClass optionally use the StepLongClass. Therefore, if your BrowseClass or ProcessClass uses the StepLongClass, your program must instantiate the StepLongClass for each use. See the Conceptual Example.
StepLongClass ABC Template Implementation
The ABC Templates (BrowseBox, Process, and Report) automatically include all the classes and generate all the code necessary to use the StepLongClass with your BrowseBoxes, Reports, and Processes.
Process and Report Procedure Templates
By default, the Process and Report templates declare a StepLongClass for integer 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 StepLongClass 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 StepLongClass for integer 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 StepLongClass so you can modify the StepLongClass behavior on an instance-by-instance basis.
StepLongClass Source Files
The StepLongClass source code is installed by default to the Clarion \LIBSRC folder. The StepLongClass source code and its respective components are contained in:
ABBROWSE.INC | StepLongClass declarations | |
ABBROWSE.CLW | StepLongClass method definitions |
StepLongClass Conceptual Example
The following example shows a typical sequence of statements to declare, instantiate, initialize, use, and terminate a StepLongClass object and related objects. The example batch processes a Customer file on an 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 StepLongClass !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