Module CUSTDEL.PKG

     1// Customer ascii deleter
     2//
     3// access method is:
     4//
     5// Send DoProcess to CustDeleter
     6//
     7
     8
     9 Object CustDeleter is a BusinessProcess
    10    Set Process_title to "Deleting All Test Customer Data"
    11
    12    Object Customer_DD is a Customer_DataDictionary
    13    end_Object
    14
    15    Procedure OnProcess
    16        string sFile sData
    17        integer hDD iCust
    18        Move Customer_DD to hDD
    19        Send clear to hDD
    20        Repeat
    21            Send Find to hDD GT Index.1
    22            If not (found) Break
    23            get Field_Current_value of hDD FIELD Customer.Name to sData
    24            if (left(sData,4)="New:") Begin
    25               Send Update_Status ("Deleteing " * sData)
    26               Send Request_Delete to hDD
    27            end
    28        Loop
    29        // reset the cust ID system counter to the lowest number possible
    30        Reread OrdSys
    31        Send Find to hDD LAST_RECORD 1
    32        Get field_current_Value of hDD field Customer.Customer_Number to iCust
    33        Move iCust to OrdSys.Cust_Number
    34        SaveRecord OrdSys
    35        Unlock
    36    end_Procedure
    37
    38End_Object
    39