home *** CD-ROM | disk | FTP | other *** search
- // DataFlex Source Code
- // Copyright 1987-1992 Data Access Corporation, Miami FL, USA
- // All Rights reserved
- //
- // LS 5/12/92
- // JR 2/7/92
-
- // Since a large part of FLEXERRS.SRC was produced by DFAUTO, it seemed
- // reasonable to simply include the code additions where possible so
- // that the source could continue to be updated with DFAUTO with a minumum
- // of overhead. This is one of the included modules.
-
- #REPLACE NO_DELETE_MODE 16
- #REPLACE NO_CREATE_MODE 64
-
- #REPLACE LAST_USER_ERROR 100
- #REPLACE SYSTEM_ERROR_OFFSET 4096
- #REPLACE UTILITY_ERROR_OFFSET 8192
-
- //--------------------------------------------------------------------------
- //--------------------------------------------------------------------------
-
- register_Object zoomPrompt
- register_Object errorPrompt
- register_Object fileTitle
-
- //--------------------------------------------------------------------------
- //--------------------------------------------------------------------------
-
- set scope_State to TRUE
- set attach_Parent_State to TRUE
-
- //--------------------------------------------------------------------------
- //--------------------------------------------------------------------------
-
- procedure entry_Update integer fileNum integer flag
- local integer recID
- forward send entry_Update fileNum flag
- if ( (errorOffset <> 0) and ;
- (item_Changed_State(current_Object,base_Item(current_Object)) or flag) ) begin
- get value item (base_Item(current_Object)) to recID
- if ( recID <> 0 ) move ( recID - errorOffset ) to recID
- move recID to Flexerrs.Recnum
- end
- end_Procedure
-
- procedure refresh integer mode
- forward send refresh mode
- if ( errorOffset <> 0 ) send display_Error_Number
- end_Procedure
-
- procedure entry_Display integer fileNum integer flag
- forward send entry_Display fileNum flag
- if ( errorOffset <> 0 ) send display_Error_Number
- end_Procedure
-
- procedure display_Error_number
- local integer recID
- move Flexerrs.Recnum to recID
- if ( recID <> 0 ) move ( recID + errorOffset ) to recID
- set value item (base_Item(current_Object)) to recID
- end_Procedure
-
- //--------------------------------------------------------------------------
- //--------------------------------------------------------------------------
-
- procedure request_Cancel
- if ( update_Row( current_Object, ( current_Row( current_Object ) ) ) = 0 ) begin
- send activate to (action_Bar_ID(current_Object))
- send deactivate AREA_TYPE
- end
- end_Procedure
-
- procedure request_Clear
- local integer svr
-
- [ not editOnlyState ] forward send request_Clear
-
- [ editOnlyState ] begin
- get Server to svr
-
- if (current_Record(svr)) eq 0 forward send request_Clear
- else send find_By_Recnum to svr (main_File(svr)) (current_Record(svr))
- end
- end_Procedure
-
- procedure request_Clear_All // disable this operation
- end_Procedure
-
- procedure request_Delete
- if (overrideEditState or ;
- (not(editOnlyState) and current_Record(server(current_Object)) GT LAST_USER_ERROR)) ;
- forward send request_Delete
- else error DFERR_DELETE_A_PROT_REC
- end_Procedure
-
- function openErrorFile string fileName string fileType number newErrorOffset integer editOnlyFlag returns integer
- direct_input ( append( fileName, ".dat" ) )
-
- if [seqEOF] begin
- close_Input
- send displayError to ( errorPrompt( current_object ) ) fileName
- function_Return (TRUE)
- end
- else begin
- close_Input
-
- if ( update_Row( current_Object, ( current_Row( current_Object ) ) ) <> 0 ) ;
- function_Return (TRUE) // save before switching!
-
- indicate err FALSE
- close Flexerrs
- open fileName as Flexerrs
-
- [err] begin
- send request_Cancel
- function_Return (TRUE)
- end
-
- [ not overrideEditState ] indicate editOnlyState as editOnlyFlag ne 0
- [ editOnlyState ] file$Mode Flexerrs (NO_DELETE_MODE + NO_CREATE_MODE)
- set no_create_state to ( editOnlyState )
-
- move newErrorOffset to errorOffset
- send setTitle to ( fileTitle( current_Object ) ) fileType fileName
- send beginning_Of_Data
- end
-
- function_Return (FALSE)
- end_Function
-
- procedure openFlexerrs
- if not (openErrorFile(current_Object,"FLEXERRS","User",0,FALSE)) ;
- send activate
- end_Procedure
-
- procedure openSystemErrors
- if not (openErrorFile(current_Object,"DFERR001","System", ;
- SYSTEM_ERROR_OFFSET,TRUE)) send activate
- end_procedure
-
- procedure openUtilityErrors
- if not (openErrorFile(current_Object,"DFERR002","Utility", ;
- UTILITY_ERROR_OFFSET,TRUE)) send activate
- end_Procedure
-
- //--------------------------------------------------------------------------
- //--------------------------------------------------------------------------
-
- /zoomButtonImg
- _____________
- /*
-
- object zoomButton is a button zoomButtonImg
-
- set location to 19 33 relative
- set focus_Mode to POINTER_ONLY
- set attach_Parent_State to TRUE
-
- item_List
- on_Item "<Alt+F9=Zoom>" send zoom
- end_Item_List
-
- end_Object
-
- //--------------------------------------------------------------------------
- //--------------------------------------------------------------------------
-
- #REPLACE FLEXERRS_LOCUS 0
- #REPLACE DFERR001_LOCUS 1
- #REPLACE DFERR002_LOCUS 2
-
- #REPLACE SEARCH_SCOPE 1
- #REPLACE SEARCH_POPUP 2
- #REPLACE SEARCH_POPUP_OR_SCOPE 3
-
- /errorPromptImg
- ╔═══════════════════════════════╗
- ║ ║
- ║ System Error... ║
- ║ ║
- ║ ____________ cannot be found. ║
- ║ ║
- ║ ____ ║
- ║ ║
- ╚═══════════════════════════════╝
- /*
-
- sub_page errorMessageImg from errorPromptImg 1
- sub_page errorButtonImg from errorPromptImg 2
-
- object errorPrompt is a client errorPromptImg
-
- set location to 5 23 absolute
- set popUp_State to TRUE
- set scope_State to TRUE
- set ring_State to TRUE
- set block_Mouse_State to TRUE
-
- object errorMessage is a message errorMessageImg
- set focus_Mode to NONFOCUSABLE
- end_object
-
- object errorButton is a button errorButtonImg
- item_List
- on_Item "<OK>" send deactivate to ( parent( current_Object ) )
- end_Item_List
- end_Object
-
- procedure displayError string fileName
- set value item 0 to ( append( fileName, ".DAT" ) )
- send popUp
- end_Procedure
-
- end_Object
-
- //--------------------------------------------------------------------------
- //--------------------------------------------------------------------------
-
- /fileTitleImg
- ____________________________________________________________
- /*
-
- object fileTitle is a message fileTitleImg
-
- set focus_Mode to NONFOCUSABLE
- set attach_Parent_State to TRUE
- set location to 1 10 relative
-
- set center_State item 0 to TRUE
-
- procedure setTitle string fileType string fileName
- set value item 0 to ( append( append( fileType, " Errors: " ), append( fileName, ".DAT" ) ) )
- end_Procedure
-
- end_Object
-
- send setTitle to ( fileTitle( current_object ) ) "User" "FLEXERRS"
-
- //--------------------------------------------------------------------------
- //--------------------------------------------------------------------------
-
- set verify_Delete_Msg to get_Verify_A_Delete
- set verify_Save_Msg to get_Verify_A_Save
-