HDR*PowerBuilder0600#@FRE*NOD*vS)ENT*06009Astr_record_count.strENT*0600 ,b?1u_ds_base.sruENT*0600,b?2str_record_count.srsENT*06009Au_ds_base.udoENT*0600:An_ds_conversion_base.udoENT*0600z:@2u_dw_base.sruENT*0600tnoA0n_ds_conversion_base.sruENT*0600+:An_ds_cache_base.udoENT*0600,Z,b?:u_tv_selection_tree.sruENT*0600 O~oA!n_ds_cache_base.sruENT*0600Q:Au_tv_selection_tree.udoENT*0600(;:An_cst_conversion_base.udoENT*0600,b?w_data_viewer.srwENT*0600 ,b?$n_cst_conversion_base.sruENT*0600HQ:Aw_data_viewer.winENT*0600 \?,d_ds_log_file.srdENT*06003,b?w_debug_text.srwENT*0600 /Ad_ds_log_file.dwoENT*0600$:Aw_debug_text.winENT*0600bg":Au_dw_base.udoDAT*PDW0800-pdwPl$#```` F$-nn``DAT*( @@DAT*$ 536870912@H   0"line< $ 0% ArialArial$DAT*2$-10$400$1$18$4$@64$6126& ! [general] [general]@DAT*'%&lineline)+ "*no",yesDAT*Datastore for n_cst_conversion_base Log Filerelease 6; datawindow(units=0 timer_interval=0 color=16777215 processing=0 print.documentname="" print.orientation = 0 print.margin.left = 110 print.margin.right = 110 print.margin.top = 96 print.margin.bottom = 96 print.paper.source = 0 print.paper.size = 0 print.prompt=no print.buttons=no print.preview.buttons=no ) summary(height=0 color="536870912" ) footer(height=0 color="536870912" ) detail(height=72 color="536870912" ) table(column=(type=char(DAT*5000) updatewhereclause=yes name=line dbname="line" ) ) column(band=detail id=1 alignment="0" tabsequence=32766 border="0" color="0" x="18" y="4" height="64" width="6126" format="[general]" name=line edit.limit=0 edit.case=any edit.focusrectangle=no edit.autoselect=no edit.nilisnull=yes edit.displayonly=yes font.face="Arial" font.height="-10" font.weight="400" font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" ) htmltable(border="1" cellpadding=DAT*4"0" cellspacing="0" generatecss="no" nowrap="yes") DAT*"Base class for export module objectsforward global type n_cst_conversion_base from nonvisualobject end type end forward shared variables //Shared data for all export modules //Internal count of all instances of this class. //This count is used to determine when the cache objects //need to be destroyed. integer si_count //array of cache object references that will be flushed //when of_flushCache() is called n_ds_cache_base snv_flushArray[] //reference to the export window wDAT*$_export sw_export //flag to indicate if export is running boolean sb_run = true //array of record count structures for log file totals str_record_count sstr_recordCount[] /**************************************************************************** Shared variables are private (not accessible by other objects or descendants) To make shared variables and objects available to other objects and all instances and descendants of this class, we also create parallel instance variables tDAT*&hat are copies or references to the shared variables. This reduces the need for private data access (set/get) functions. Here are the steps to create instance copies or references to shared data: 1) Add declaration here 2) Add declaration in instance variables section 3) Add assignment line in of_synchronize() to copy the value or reference 4) Add constructor statements (for objects) 5) Add destructor statements (for objects) Note: of_synchronize() is called by the constructor andDAT*( of_initialize(), so it is only necessary to call of_synchronize() if shared values are changed after the object is created. This will be necessary for all instances in order to bring everything into sync. ****************************************************************************/ //export parameters //string ss_exportPath //string ss_baseFileName //log file datastore n_ds_conversion_base sds_logFile end variables global type n_cst_conversion_base from nonvisualobject DAT**event ue_synchronize ( ) event type integer ue_initialize ( ) end type global n_cst_conversion_base n_cst_conversion_base type variables w_export iw_export //constants constant string CRLF = "~r~n" //public instance variable refrences to shared (private) variables n_ds_conversion_base ids_logFile string is_errormessage end variables forward prototypes public function integer of_writelogmessagemidcount (n_ds_conversion_base ads_export, long al_rowcount, string as_message) publDAT*,ic function integer of_setexportwindow (w_export aw_export) public function integer of_setrun (boolean ab_run) public function integer of_synchronize () public function integer of_writelogmessage (string as_message) public function integer of_writelogmessageend (n_ds_conversion_base ads_export) public function integer of_writelogmessageerror (n_ds_conversion_base ads_export, string as_message) public function integer of_writelogmessagemid (n_ds_conversion_base ads_export, string as_message) DAT*. public function integer of_writelogmessagestart (n_ds_conversion_base ads_export) public function integer of_writelogtotals () public function integer of_writestatusmessage (string as_message) public function integer of_addtototals (n_ds_conversion_base ads_export) public function string of_elapsedtime (datetime adt_start, datetime adt_end) public function integer of_export () public function integer of_flushcache () public function boolean of_getrun () public function string of_leftpad (DAT*0string as_mainstring, integer ai_length, character as_padwith) public function integer of_resettotals () public function integer of_addtoflusharray (n_ds_cache_base anv_cacheobject) public function integer of_writelogmessagewarning (n_ds_conversion_base ads_export, string as_message) public function integer of_initialize () public function integer of_writelogmessageerror (string as_message) public function integer of_writelogmessagewarning (string as_message) end prototypes event ue_syncDAT*2hronize; //these values are copies of private shared data //these values are references to private shared objects iw_export = sw_export ids_logFile = sds_logFile end event public function integer of_writelogmessagemidcount (n_ds_conversion_base ads_export, long al_rowcount, string as_message); //write standard message for export file mid processing with record count long ll_rc ll_rc = this.of_writeLogMessage(ads_export.of_getFileDescription() + ": " + as_message + "; " +&DAT*4 string(al_rowCount)+ " records found.") return ll_rc end function public function integer of_setexportwindow (w_export aw_export);//******************************************************************************** // // Object: n_cst_conversion_base inherited from nonvisualobject // Function: of_setExportWindow // Access: public // Arguments: w_export aw_export // Returns: integer // Description: Set the internal export window reference // //*****************DAT*6*************************************************************** // Revision History // Date Name Revision //-------------------------------------------------------------------------------- // 10/13/2000 Mark Young Initial Version //******************************************************************************** sw_export = aw_export this.of_synchronize() return 1 end function public function integer of_setrun (boolean ab_run);//*********************************************DAT*8*********************************** // // Object: n_cst_conversion_base inherited from nonvisualobject // Function: of_setrun // Access: public // Arguments: boolean ab_run // Returns: integer // Description: Sets the sb_run flag // //******************************************************************************** // Revision History // Date Name Revision //-------------------------------------------------------------------------------- // 10/14/2000 Mark Young DAT*: Initial Version //******************************************************************************** sb_run = ab_run return 1 end function public function integer of_synchronize ();//******************************************************************************** // // Object: n_cst_conversion_base inherited from nonvisualobject // Function: of_synchronize // Access: public // Arguments: none // Returns: integer // Description: Copy shared variables to instancDAT*<e variables, via event call // //******************************************************************************** // Revision History // Date Name Revision //-------------------------------------------------------------------------------- // 10/13/2000 Mark Young Initial Version // 04/17/2001 Mark Young Modified to call ue_synchronize //******************************************************************************** this.trigger event ue_synchronize() return 1 end function DAT*> public function integer of_writelogmessage (string as_message);//******************************************************************************** // // Object: n_cst_conversion_base inherited from nonvisualobject // Function: of_writeLogMessage // Access: public // Arguments: string as_message // Returns: integer // Description: Inserts a row into the log file datastore and enters the message // //***********************************************************************DAT*@********* // Revision History // Date Name Revision //-------------------------------------------------------------------------------- // 10/13/2000 Mark Young Initial Version //******************************************************************************** long ll_row sw_export.dw_log_file.setRedraw(false) ll_row = ids_logFile.insertRow(0) if ll_row < 0 then sw_export.dw_log_file.setRedraw(true) signalError(-1, "Failed inserting row into log file.") return -1 end if DAT*B ids_logFile.object.line[ll_row] = as_message //scroll the visible datawindow sw_export.dw_log_file.scrollToRow(ll_row) sw_export.dw_log_file.setRedraw(true) return 1 end function public function integer of_writelogmessageend (n_ds_conversion_base ads_export);//******************************************************************************** // // Object: n_cst_conversion_base inherited from nonvisualobject // Function: of_writelogmessageend // Access: public // DAT*DArguments: n_ds_conversion_base ads_export // Returns: integer // Description: write standard message for export file end // //******************************************************************************** // Revision History // Date Name Revision //-------------------------------------------------------------------------------- // 11/16/2000 Mark Young Initial Version //******************************************************************************** long ll_rc if isnDAT*Full(ads_export.il_rowError) then ads_export.il_rowError = 0 end if ll_rc = this.of_writeLogMessage(ads_export.of_getFileDescription() + ": " +& string(ads_export.rowCount()) + " records written. " +& string(ads_export.il_rowError) + " records in error.") return ll_rc end function public function integer of_writelogmessageerror (n_ds_conversion_base ads_export, string as_message);//******************************************************************************** // // ODAT*Hbject: n_cst_conversion_base inherited from nonvisualobject // Function: of_writelogmessageerror // Access: public // Arguments: n_ds_conversion_base ads_export // string as_message // Returns: integer // Description: write standard message for export file error processing // //******************************************************************************** // Revision History // Date Name Revision //----------------------------------------------------------------DAT*J---------------- // 11/16/2000 Mark Young Initial Version //******************************************************************************** long ll_rc //increment the datastore's internal error count ads_export.il_rowError ++ ll_rc = this.of_writeLogMessage("*Error: " + ads_export.of_getFileDescription() + ": " + as_message) return ll_rc end function public function integer of_writelogmessagemid (n_ds_conversion_base ads_export, string as_message);//*****************DAT*L*************************************************************** // // Object: n_cst_conversion_base inherited from nonvisualobject // Function: of_writelogmessagemid // Access: public // Arguments: n_ds_conversion_base ads_export // string as_message // Returns: integer // Description: write standard message for export file mid processing // //******************************************************************************** // Revision History // Date Name ReDAT*Nvision //-------------------------------------------------------------------------------- // 11/16/2000 Mark Young Initial Version //******************************************************************************** long ll_rc ll_rc = this.of_writeLogMessage(ads_export.of_getFileDescription() + ": " + as_message) return ll_rc end function public function integer of_writelogmessagestart (n_ds_conversion_base ads_export);//*****************************************************DAT*P*************************** // // Object: n_cst_conversion_base inherited from nonvisualobject // Function: of_writelogmessagestart // Access: public // Arguments: n_ds_conversion_base ads_export // Returns: integer // Description: Write standard message for export file begin // //******************************************************************************** // Revision History // Date Name Revision //------------------------------------------------------------DAT*R-------------------- // 11/16/2000 Mark Young Initial Version //******************************************************************************** long ll_rc ll_rc = this.of_writeLogMessage(ads_export.of_getFileDescription() + ": Exporting...") return ll_rc end function public function integer of_writelogtotals ();//******************************************************************************** // // Object: n_cst_conversion_base inherited from nonvisualobject // FDAT*Tunction: of_writeLogTotals // Access: public // Arguments: none // Returns: integer // Description: Writes out the file record totals for the current export. // //******************************************************************************** // Revision History // Date Name Revision //-------------------------------------------------------------------------------- // 10/19/2000 Mark Young Initial Version //***************************************************************DAT*V***************** integer li_index string ls_description long ll_rows long ll_errors this.of_writeLogMessage("EXPORT TOTALS:") //search for current file description in the array for li_index = 1 to upperBound(sstr_recordCount) if trim(sstr_recordCount[li_index].description) = "" then continue end if this.of_writeLogMessage(sstr_recordCount[li_index].description + ": " +& string(sstr_recordCount[li_index].row_count) + " records written. " +& string(sstr_recordCoDAT*Xunt[li_index].error_count) + " records in error.") next return 1 end function public function integer of_writestatusmessage (string as_message);//******************************************************************************** // // Object: n_cst_conversion_base inherited from nonvisualobject // Function: of_writestatusmessage // Access: public // Arguments: string as_message // Returns: integer // Description: Writes a status message to w_export // //****DAT*Z**************************************************************************** // Revision History // Date Name Revision //-------------------------------------------------------------------------------- // 10/13/2000 Mark Young Initial Version //******************************************************************************** if not isValid(sw_export) then signalError(-1, "Invalid window reference sw_export.") return -1 end if sw_export.sle_export_status.text = as_message rDAT*\eturn 1 end function public function integer of_addtototals (n_ds_conversion_base ads_export);//******************************************************************************** // // Object: n_cst_conversion_base inherited from nonvisualobject // Function: of_addtototals // Access: public // Arguments: n_ds_conversion_base ads_export // Returns: integer // Description: Adds information about an n_ds_conversion_base object to the totals array. // //******************DAT*^************************************************************** // Revision History // Date Name Revision //-------------------------------------------------------------------------------- // 10/19/2000 Mark Young Initial Version //******************************************************************************** integer li_index string ls_description //grab the file description ls_description = ads_export.of_getFileDescription() if trim(ls_description) = "" then //don't procesDAT*`s if no file description given return 0 end if //search for current file description in the array for li_index = 1 to upperBound(sstr_recordCount) if sstr_recordCount[li_index].description = ls_description then exit end if next //add or update record count information in the array if li_index > upperBound(sstr_recordCount) then //not found, add to array sstr_recordCount[li_index].description = ls_description sstr_recordCount[li_index].row_count = ads_export.rowCount() ssDAT*btr_recordCount[li_index].error_count = ads_export.il_rowError else //found, just increment counters sstr_recordCount[li_index].row_count += ads_export.rowCount() sstr_recordCount[li_index].error_count += ads_export.il_rowError end if return 1 end function public function string of_elapsedtime (datetime adt_start, datetime adt_end);//******************************************************************************** // // Object: n_cst_conversion_base inherited from nonvisualobjeDAT*dct // Function: of_elapsedTime // Access: public // Arguments: datetime adt_start // datetime adt_end // Returns: string // Description: Calculates the elapsed time between two datetime variables. // //******************************************************************************** // Revision History // Date Name Revision //-------------------------------------------------------------------------------- // 10/23/2000 Mark Young Initial Version //**************DAT*f****************************************************************** date ld_endDay time lt_endTime date ld_startDay time lt_startTime long ll_elapsedDays long ll_elapsedHours long ll_elapsedMinutes long ll_elapsedSeconds string ls_elapsedTime = "" string ls_days constant long SECONDS_IN_DAY = 86400 constant long SECONDS_IN_HOUR = 3600 constant long SECONDS_IN_MINUTE = 60 ld_endDay = date(adt_end) lt_endTime = time(adt_end) ld_startDay = date(adt_start) lt_startTime = time(adtDAT*h_start) ll_elapsedDays = daysAfter(ld_startDay, ld_endDay) ll_elapsedSeconds = secondsAfter(lt_startTime, lt_endTime) //total elapsed seconds ll_elapsedSeconds = (ll_elapsedDays * SECONDS_IN_DAY) + ll_elapsedSeconds //calc elapsed days ll_elapsedDays = ll_elapsedSeconds / SECONDS_IN_DAY if ll_elapsedDays > 0 then if ll_elapsedDays > 1 then ls_days = " days " else ls_days = " day " end if //remove days from elapsed seconds ll_elapsedSeconds = mod(ll_elapsedSeconds, ll_eDAT*jlapsedDays * SECONDS_IN_DAY) ls_elapsedTime = string(ll_elapsedDays) + " day " end if //calc elapsed hours ll_elapsedHours = ll_elapsedSeconds / SECONDS_IN_HOUR if ll_elapsedHours > 0 then //remove hours from elapsed seconds ll_elapsedSeconds = mod(ll_elapsedSeconds, ll_elapsedHours * SECONDS_IN_HOUR) end if //calc elapsed minutes ll_elapsedMinutes = ll_elapsedSeconds / SECONDS_IN_MINUTE if ll_elapsedMinutes > 0 then //remove minutes from elapsed seconds ll_elapsedSeconds = mDAT*lod(ll_elapsedSeconds, ll_elapsedMinutes * SECONDS_IN_MINUTE) end if ls_elapsedTime = ls_elapsedTime +& string(ll_elapsedHours, "00:") +& string(ll_elapsedMinutes, "00:") +& string(ll_elapsedSeconds, "00") return ls_elapsedTime end function public function integer of_export ();//******************************************************************************** // // Object: n_cst_conversion_base inherited from nonvisualobject // Function: of_export // Access: puDAT*nblic // Arguments: none // Returns: integer // Description: This function should be defined in descendant classes // //******************************************************************************** // Revision History // Date Name Revision //-------------------------------------------------------------------------------- // 11/16/2000 Mark Young Initial Version //******************************************************************************** return 0 end function DAT*p public function integer of_flushcache ();//******************************************************************************** // // Object: n_cst_conversion_base inherited from nonvisualobject // Function: of_flushCache // Access: public // Arguments: none // Returns: integer // Description: Resets all cache objects in the flush array. // //******************************************************************************** // Revision History // Date Name Revision DAT*r//-------------------------------------------------------------------------------- // 10/13/2000 Mark Young Initial Version //******************************************************************************** integer li_i //loop through the flush array for li_i = 1 to upperBound(snv_flushArray) if not isValid(snv_flushArray[li_i]) then return 0 end if //call of_reset() for each cache object if snv_flushArray[li_i].of_reset() < 0 then return -1 end if next retDAT*turn 1 end function public function boolean of_getrun ();//******************************************************************************** // // Object: n_cst_conversion_base inherited from nonvisualobject // Function: of_getrun // Access: public // Arguments: none // Returns: boolean // Description: Returns the run status. // //******************************************************************************** // Revision History // Date Name Revision //-------DAT*v------------------------------------------------------------------------- // 10/14/2000 Mark Young Initial Version //******************************************************************************** //let pending events take place first do while yield() loop return sb_run end function public function string of_leftpad (string as_mainstring, integer ai_length, character as_padwith);//******************************************************************************** // // ObjeDAT*xct: n_cst_conversion_base inherited from nonvisualobject // Function: of_leftpad // Access: public // Arguments: string as_mainstring // integer ai_length // character as_padwith // Returns: string // Description: will left pad a main string with a specified character of a given // length. If the character is null or the length is less than one // then return the main string. This program will strip spaces at // at the beginning/end of the stringDAT*z before padding with a specified // character. //******************************************************************************** // Revision History // Date Name Revision //-------------------------------------------------------------------------------- // 11/06/2000 Michael Colombo Initial Version //******************************************************************************** //If the character is null or the length is less than one then return mainstring if isnull(as_DAT*|padwith) or ai_length < 1 then return as_mainString end if //returns left padded string return right(fill(as_padwith, ai_length) + trim(as_mainString), ai_length ) end function public function integer of_resettotals ();//******************************************************************************** // // Object: n_cst_conversion_base inherited from nonvisualobject // Function: of_resettotals // Access: public // Arguments: none // Returns: integer // DescriDAT*~ption: Reset the totals array for new export run. // //******************************************************************************** // Revision History // Date Name Revision //-------------------------------------------------------------------------------- // 10/19/2000 Mark Young Initial Version //******************************************************************************** str_record_count lstr_recordCount[] //assign empty array to shared array sstr_recordCount = lstrDAT*_recordCount return 1 end function public function integer of_addtoflusharray (n_ds_cache_base anv_cacheobject);//******************************************************************************** // // Object: n_cst_conversion_base inherited from nonvisualobject // Function: of_addToFlushArray // Access: public // Arguments: n_ds_cache_base anv_cacheObject // Returns: integer // Description: // Adds a cache object to the flush array. All items in the array canDAT* be // reset by calling of_flushCache() // //******************************************************************************** // Revision History // Date Name Revision //-------------------------------------------------------------------------------- // 10/13/2000 Mark Young Initial Version //******************************************************************************** integer li_index //add the cache object to the flush array li_index = upperBound(snv_flushArray) + 1 snDAT*v_flushArray[li_index] = anv_cacheObject return 1 end function public function integer of_writelogmessagewarning (n_ds_conversion_base ads_export, string as_message);//******************************************************************************** // // Object: n_cst_conversion_base inherited from nonvisualobject // Function: of_writelogmessagewarning // Access: public // Arguments: n_ds_conversion_base ads_export // string as_message // Returns: integer // DAT*Description: write standard message for export file error processing // //******************************************************************************** // Revision History // Date Name Revision //-------------------------------------------------------------------------------- // 11/16/2000 Mark Young Initial Version //******************************************************************************** long ll_rc ll_rc = this.of_writeLogMessage("*Warning: " + ads_export.of_getFiDAT*leDescription() + ": " + as_message) return ll_rc end function public function integer of_initialize ();//******************************************************************************** // // Object: n_cst_conversion_base inherited from nonvisualobject // Function: of_initialize // Access: public // Arguments: none // Returns: integer // Description: initialize this object // //******************************************************************************** DAT*// Revision History // Date Name Revision //-------------------------------------------------------------------------------- // 10/13/2000 Mark Young Initial Version // 04/17/2001 Mark Young Modified to call ue_initialize //******************************************************************************** return this.trigger event ue_initialize() end function public function integer of_writelogmessageerror (string as_message);//****************************************************DAT***************************** // // Object: n_cst_conversion_base inherited from nonvisualobject // Function: of_writelogmessageerror // Access: public // Arguments: string as_message // Returns: integer // Description: write standard message for export file error processing // //******************************************************************************** // Revision History // Date Name Revision //--------------------------------------------------------------DAT*------------------ // 11/16/2000 Mark Young Initial Version //******************************************************************************** long ll_rc ll_rc = this.of_writeLogMessage("*Error: " + as_message) return ll_rc end function public function integer of_writelogmessagewarning (string as_message);//******************************************************************************** // // Object: n_cst_conversion_base inherited from nonvisualobject // FunctionDAT*: of_writelogmessagewarning // Access: public // Arguments: string as_message // Returns: integer // Description: write standard message for export file error processing // //******************************************************************************** // Revision History // Date Name Revision //-------------------------------------------------------------------------------- // 11/16/2000 Mark Young Initial Version //***************************************************DAT****************************** long ll_rc ll_rc = this.of_writeLogMessage("*Warning: " + as_message) return ll_rc end function on n_cst_conversion_base.create TriggerEvent( this, "constructor" ) end on on n_cst_conversion_base.destroy TriggerEvent( this, "destructor" ) end on event constructor;//******************************************************************************** // // Object: n_cst_conversion_base inherited from nonvisualobject // Function: // DAT* Access: // Arguments: none // Returns: // Description: // Handles internal instance counter and creates cache objects if necessary. // //******************************************************************************** // Revision History // Date Name Revision //-------------------------------------------------------------------------------- // 10/13/2000 Mark Young Initial Version //******************************************************************************** /DAT*/increment the internal class instance count si_count ++ //create the log file datastore if not isValid(sds_logFile) then sds_logFile = create n_ds_conversion_base if not isValid(sds_logFile) then signalError(-1, "Failed creating Log File datastore.") return -1 end if //register this export object with log file object //this will set the shared registration variable for all n_ds_conversion_base objects sds_logFile.of_register(this) //set the file extension and dDAT*ata object sds_logFile.of_setDataType("log", "d_ds_log_file") end if ////create rap units cache //if not isValid(snv_rapUnits) then // // snv_rapUnits = create nvo_rap_units // if not isValid(snv_rapUnits) then // signalError(-1, "Failed creating Rap Units cache.") // return -1 // end if // // //register with the export object // snv_rapUnits.of_register(this) // //end if // ////create rap control codes cache //if not isValid(snv_rapControlCodes) then // // snv_raDAT*pControlCodes = create nvo_rap_control_codes // if not isValid(snv_rapControlCodes) then // signalError(-1, "Failed creating Rap Control Codes cache.") // return -1 // end if // // //register with the export object // snv_rapControlCodes.of_register(this) // //end if // ////create rap scc codes cache //if not isValid(snv_rapSccCodes) then // // snv_rapSccCodes = create nvo_rap_scc_codes // if not isValid(snv_rapSccCodes) then // signalError(-1, "Failed creating Rap SCC Codes DAT*cache.") // return -1 // end if // // //register with the export object // snv_rapSccCodes.of_register(this) // //end if // ////create rap minnesota cities cache //if not isValid(snv_rapMinnesotaCities) then // // snv_rapMinnesotaCities = create nvo_rap_minnesota_cities // if not isValid(snv_rapMinnesotaCities) then // signalError(-1, "Failed creating Rap Minnesota Cities cache.") // return -1 // end if // // //register with the export object // snv_rapMinnesotaCities.of_DAT*register(this) // //end if // ////create source data cache ////this is the master cache that drives the export process //if not isValid(snv_sourceData) then // // snv_sourceData = create nvo_source_data // if not isValid(snv_sourceData) then // signalError(-1, "Failed creating Source Data cache.") // return -1 // end if // // //register with the export object // snv_sourceData.of_register(this) // // //Do not add this object to the flush array, since it should only // //be DAT*cleared/re-populated by the source selector // // //this.of_addToFlushArray(snv_sourceData) // //end if // // ////create mirror lookup cache //if not isValid(snv_mirrorLookup) then // // snv_mirrorLookup = create nvo_mirror_Lookup // if not isValid(snv_mirrorLookup) then // signalError(-1, "Failed creating Mirror Lookup cache.") // return -1 // end if // // //register with the export object // snv_mirrorLookup.of_register(this) // //end if // ////create fac item associDAT*ation cache //if not isValid(snv_facItemAssociation) then // // snv_facItemAssociation = create nvo_fac_Item_Association // if not isValid(snv_facItemAssociation) then // signalError(-1, "Failed creating Fac Item Association Data cache.") // return -1 // end if // // //register with the export object // snv_facItemAssociation.of_register(this) // // //adds this object to the flush array since it should be cleared // //and re-populated for each export block // this.of_addToFlushDAT*Array(snv_facItemAssociation) // //end if // ////create stack process cache //if not isValid(snv_stackProcess) then // // snv_stackProcess = create nvo_stack_process // if not isValid(snv_stackProcess) then // signalError(-1, "Failed creating Fac Item Association Data cache.") // return -1 // end if // // //register with the export object // snv_stackProcess.of_register(this) // // //adds this object to the flush array since it should be cleared // //and re-populated for eaDAT*ch export block // this.of_addToFlushArray(snv_stackProcess) // //end if // ////create fac item cache //if not isValid(snv_facItem) then // // snv_facItem = create nvo_fac_item // if not isValid(snv_facItem) then // signalError(-1, "Failed creating Fac Item Data cache.") // return -1 // end if // // //register with the export object // snv_facItem.of_register(this) // // //adds this object to the flush array since it should be cleared // //and re-populated for each export DAT*block // this.of_addToFlushArray(snv_facItem) // //end if // ////create other inventory cache //if not isValid(snv_otherinventory) then // // snv_otherinventory = create nvo_other_inventory // if not isValid(snv_otherinventory) then // signalError(-1, "Failed creating Other Inventory Data cache.") // return -1 // end if // // //register with the export object // snv_otherinventory.of_register(this) // // //adds this object to the flush array since it should be cleared // /DAT*/and re-populated for each export block // this.of_addToFlushArray(snv_otherinventory) // //end if // ////create process cache //if not isValid(snv_process) then // // snv_process = create nvo_process // if not isValid(snv_process) then // signalError(-1, "Failed creating Process Data cache.") // return -1 // end if // // //register with the export object // snv_process.of_register(this) // // //adds this object to the flush array since it should be cleared // //and re-popDAT*ulated for each export block // this.of_addToFlushArray(snv_process) // //end if // ////create emissions cache //if not isValid(snv_emissions) then // // snv_emissions = create nvo_emissions // if not isValid(snv_emissions) then // signalError(-1, "Failed creating Emissions Data cache.") // return -1 // end if // // //register with the export object // snv_emissions.of_register(this) // // //adds this object to the flush array since it should be cleared // //and re-populatDAT*ed for each export block // this.of_addToFlushArray(snv_emissions) // //end if //copy shared variables to instance variables this.of_synchronize() return 1 end event event destructor;//******************************************************************************** // // Object: n_cst_conversion_base inherited from nonvisualobject // Function: // Access: // Arguments: none // Returns: // Description: // Handles internal instance counter and destroysDAT* cache objects if necessary. // //******************************************************************************** // Revision History // Date Name Revision //-------------------------------------------------------------------------------- // 10/13/2000 Mark Young Initial Version //******************************************************************************** //decrement the internal instance count si_count -- //if there are other instances of this class, don't destroy shareDAT*d cache objects if si_count > 0 then return 0 end if //destroy log file datastore if isValid(sds_logFile) then destroy sds_logFile end if ////destroy cache objects //if isValid(snv_rapUnits) then // destroy snv_rapUnits //end if // //if isValid(snv_rapControlCodes) then // destroy snv_rapControlCodes //end if // //if isValid(snv_rapSccCodes) then // destroy snv_rapSccCodes //end if // //if isValid(snv_rapMinnesotaCities) then // destroy snv_rapMinnesotaCities //end if DAT* // //if isValid(snv_sourceData) then // destroy snv_sourceData //end if // //if isValid(snv_facItemAssociation) then // destroy snv_facItemAssociation //end if // //if isValid(snv_facItem) then // destroy snv_facItem //end if // //if isValid(snv_otherInventory) then // destroy snv_otherInventory //end if // //if isValid(snv_process) then // destroy snv_process //end if // //if isValid(snv_stackProcess) then // destroy snv_stackProcess //end if // //if isvalid(snv_mirrorLoDAT*okup) then // destroy snv_mirrorLookup //end if // //if isvalid(snv_emissions) then // destroy snv_emissions //end if return 1 end event DAT*p@)b?:Ap@p@ p@q@@a!\@\@a,[@[@a8c@c@aEU@U@aV`@`@q`j@j@qnk@k@zl@l@m@m@q@@q@@@@@@^@^@a@@`@@a"@@,@@7@@AS@S@J@@v@v@ w_debug_textwindowmenuwindowtypewindowstatewindowobjecttoolbaralignmentstructuremailrecipientenvironmentmailfiledescriptionmaDAT*ilmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobject   multilineeditfontcharsetfontpitchfontfamilyalignmenttextcaseborderstylehe Debug Text  ArialsthpmessageX2 w_debug_text  +create+destroy+open QL DAT*xD _initsrcwindoww_debug_textmenuwindowtypewindowstatewindowobjecttoolbaralignmentstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectmultilineeditmle_1fontcharsetfontpitchfontfamilyalignmenttextcaseborderstylemessage etwin.d@rintenints%Se@sysp*hs@getw5ct@kernAWi@sDirNst@rorDAT*o@~oA:A o@To@a-@@a6 a@aL@@aWI@I@ab^@^@qcrn`q@q@al))ar0 n_ds_cache_basen_ds_conversion_basedwobjectn_cst_conversion_basefileaccesssaveastypepowerobject?Cy   DAT*transactionsqlcap82 n_ds_cache_base  al_rowas_actionaa_data+ue_scanrow+ue_populate+ue_scanbegin+ue_scanend+ue_populateendas_findof_findof_findnextof_getcountas_columnof_getdataof_populateof_resetof_setdataas_dataobjectof_setdataobjectof_scanof_scanreverse+create+destroyP LLSALQpfidBSBn_dDAT*LSaASI ) LSA8L\p x _initsrcn_ds_conversion_basen_ds_cache_basedwobjectn_cst_conversion_basefileaccesssaveastypepowerobjecttransaction rcastose@bjec&ereci6ro@tma?ri@nmaUda@ndow`vi@DAT*@9)b?:A@@ @%@@1@@;@@F@@R$@$@]`@`@gj@j@uk@k@l@l@m@m@a@@@@@@@@^@^@ F@F@v@v@e H u_tv_selection_treetreeviewfontcharsetfontpitchfontfamilyborderstylegrsorttypestructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfDAT*`@9)b?9A `@`@t`@a#j@j@a1k@k@=l@l@aQm@m@a]@@am@@Qz@@a@@^@^@ str_record_countstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobject2   x structurestr_record_countmailrecipientenvironmentmailfiledescriptionmailmessagedatawinDAT*dowchildlistviewitemtreeviewitemconnectioninfopowerobject@#@1@=@Q@]@m@z@ @ @ 2  2 * descriptionrow_counterror_count< ^@DAT* DAT*o@8)b?9Ao@o@to@a@@a%`@`@q/j@j@q=k@k@qIl@l@a]m@m@qi@@ay@@@@@@a^@^@atu@u@@@q@q@Av@v@qa u_ds_basedatastoredwobjectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectextobjectdwbuffertransactionsqlcamessage2DAT* u_ds_base s al_rowof_getrecordstring+create+destroysqldbcodesqlerrtextsqlsyntaxbufferrow+dberror+constructorj SLQunt3=HRYLLSSCdwbuffer.LL x _initsrcdatastoreu_ds_basedwobjectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectextDAT**objectdwbuffertransactionmessageh urr_rem@eciponmai%ip@mai.at@dowc8ie@mtrFc@ctioRro@tf@ r@@ @ @@_sel @ @@ @ @@ DAT*o@oA:Ao@o@o@'@@0`@`@:j@j@Hk@k@Tl@l@hm@m@t@@@@@@@@^@^@ a@@@I@I@ADq@q@P@@AYF@F@agu@u@q@@~v@v@ n_ds_conversion_basedatastoredwobjectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewiteDAT*mconnectioninfopowerobject?$conv.tmpn_cst_conversion_basefileaccesssaveastype3" transactiondwbufferpointersqlcaextobjectdwitemstatusf_sqlcheckmessage2_ si_countss_exportpathss_basepathnamess_tempfilenamesnv_exportn_ds_conversion_basex/?J 0DAT*opowerobjectco  NotFound!tvNselct.bmptvPselct.bmptvFselct.bmpArialt  8  PBO\  8  PBO\ [ 8 ! BO\DAT*pointermessagepP2 u_tv_selection_tree  +ue_initialize+ue_processselections+ue_selectionchanged+ue_processallselectionsal_handleaa_dataof_setitemdataatvi_itemof_toggleitemstateai_stateof_setitemstateal_childhandleai_childstateai_oldchildstateof_setparentstategetitemastruct_dataof_getitemdatasetitemal_parenthandleinsertitemDAT*lastof_resetinsertitemfirstof_getallselecteditemsof_getselecteditemsab_redrawsetredrawai_modeof_insertiteminsertitemsorthandle+rightclicked  LQ[eILA|eIRCtreeviewitem.A[IL[ILIILII[|ILRCtreeviewitem.|IXCtreeviewitem.RCostruct_tvi_data.[|ILCtreeviewitem.|DAT* +ue_cleanup+ue_postblockupdateal_startrowal_endrowas_actionaa_data+ue_scanblockas_columnof_stripnonprintableof_filecloseai_fileidof_fileopenaa_columnof_getdecimalfieldplaceof_getfiledescriptionof_getpathnameof_getstringfieldlengthai_sequenceof_loadfromfileanv_exportof_registerof_resetaa_arg1of_retrieveappendaa_arg2aa_arg3aa_arg4aa_arg5aa_arg6aa_arg7aa_arg8of_savetofileas_exportpathas_basefilenameof_setbasepathnameas_extas_dataobjectof_setdatatypeae_fDAT*Pileaccessof_setfileaccessas_descriptionof_setfiledescriptionab_headingsof_setfileheadingsas_nameof_setfilenameae_saveastypeof_setfiletypeab_keepfileopenof_setkeepfileopenof_getfieldlimitas_dataof_checkcasencof_addrowbaseai_columnal_rowof_checkformatof_getrecordstringof_fileexistsof_getpathab_loadblanklinesof_setloadblanklinesof_basepathnamesetncas_arg1ncas_recordstringof_parserecordstringal_updateblocksizeof_setupdateblocksizeatr_transactDAT*Base class for Datawindow. Handles DBError event.forward global type u_dw_base from datawindow end type end forward global type u_dw_base from datawindow integer width = 494 integer height = 360 integer taborder = 1 boolean livescroll = true event ue_scanend ( ) event ue_scanbegin ( ) event type long ue_scanrow ( long al_row, string as_action, any aa_data ) end type global u_dw_base u_dw_base type variables string is_sql boolean ib_retrieveappend = false end variables foDAT*rward prototypes public function integer of_retrieveappend (any aa_arg1) public function long of_retrieveappend (any aa_arg1, any aa_arg2, any aa_arg3, any aa_arg4, any aa_arg5, any aa_arg6, any aa_arg7, any aa_arg8, any aa_arg9, any aa_arg10, any aa_arg11, any aa_arg12, any aa_arg13) public function long of_scan (string as_action, any aa_data) public function long of_scanreverse (string as_action, any aa_data) public function long of_scanreverse (string as_action) public function long of_scDAT*Van (string as_action) end prototypes event type long ue_scanrow(long al_row, string as_action, any aa_data); //******************************************************************************** // // Object: n_ds_cache_base inherited from n_ds_conversion_base // Event: ue_scanrow // Arguments: long al_row // string as_action // any aa_data // Returns: long // (Return NULL to stop the scanning process normally) // (Return value < 0 to stop the scannDAT*LLCtreeviewitem.I|[[IB|LLCtreeviewitem.I|LL (Td@l x _initsrctreeviewu_tv_selection_treefontcharsetfontpitchfontfamilyborderstylegrsorttypestructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowDAT*childlistviewitemtreeviewitemconnectioninfopowerobjectostruct_tvi_datapointermessage tedle@is_m .es@@:@emphD@Ope@iled[@f@ pe@~ @` @  @$ |@ 4@8@z&@8<@@@DAT*@ kI"71     L1)8<1<"<d ll_rc$ of_getselecteditemsi . 9}@9}d DAT*_e@n+cite@strow ve@f_ex vi@ @fon tf@yal ll@erne@windob@datsa@bjecct@84$@%8@8@@@1'@A 0@!<@ wW +*@2DAT*((@*(0$ |d 8 mle_1*control c@* ( 0 $d  mle_1^@* `$ ,($6,F1T,0$,d message::message(@DAT*@8 mle_1oc*textsca  ( 0 &&2  +create+destroy+open< rclicascturpi2 O xywidthheighttitlebartitlebackcolorcontrolmenuwindowtypemle_1N  N "(2>DAT*I ] oN N   1  @@@  x&DAT*Da@9)b?:Aa@a@ a@.`@`@8j@j@Fk@k@Rl@l@fm@m@r@@@@@@@@^@^@o@p@`@`o@ n_cst_conversion_basenonvisualobjectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectn_ds_cache_basew_exportstr_record_countn_ds_conversion_base 2~ DAT*Base class for cache data objectsforward global type n_ds_cache_base from n_ds_conversion_base end type end forward global type n_ds_cache_base from n_ds_conversion_base event type long ue_scanrow ( long al_row, string as_action, any aa_data ) event type long ue_populate ( ) event ue_scanbegin ( ) event ue_scanend ( ) event ue_populateend ( ) end type global n_ds_cache_base n_ds_cache_base type variables //find string string is_find //last row accessed via of_find() of_finDAT*dNext() or of_getData() long il_row = -1 end variables forward prototypes public function boolean of_find (string as_find) public function boolean of_findnext () public function long of_getcount (string as_find) public function any of_getdata (string as_column) public function long of_populate () public function integer of_reset () public function long of_setdata (string as_column, any aa_data) public function long of_setdataobject (string as_dataobject) public function long of_sDAT*can (string as_action) public function long of_scanreverse (string as_action) public function long of_scanreverse (string as_action, any aa_data) public function long of_scan (string as_action, any aa_data) end prototypes event ue_scanrow; //******************************************************************************** // // Object: n_ds_cache_base inherited from n_ds_conversion_base // Event: ue_scanrow // Arguments: long al_row // string as_action // any aaDAT*_data // Returns: long // (Return NULL to stop the scanning process normally) // (Return value < 0 to stop the scanning with error status) // Description: // This event is triggered by the of_scan() function, which loops through the // datastore and "visits" each row. This event is triggered once for each row // visited, processing can be done on a row by row basis. A case block is used to // determine what action to perform on each row (e.g. a function call or other DAT* // operation). Any data needed for row processing can be passed in via the aa_data // argument. If this event returns NULL, the whole scan is stopped. // // NOTE: This event should be extended by descendant classes in order to // perform specific processing on the row given in al_row. The as_action // argument should be checked in a CASE block in order to determine what // action should be performed. // //********************************************************************DAT************* // Revision History // Date Name Revision //-------------------------------------------------------------------------------- // 10/12/2000 Mark Young Initial Version //******************************************************************************** //EXTEND this script as follows //DO NOT place code here in the base class unless it will apply to all //objects of this class and its descendants //EXAMPLE: /* //Return NULL to stop the scanning process normally //DAT*(of_scan() will return the row stopped on) //Return Negative Value to stop the scanning process with error status //(of_scan() will return the Negative Value) //force argument to upper case as_action = upper(trim(as_action)) choose case as_action // ************************************************************************* case "ACTION 1" // ************************************************************************* function_1(aa_data) // ****************************DAT********************************************** case "ACTION 2" // ************************************************************************* function_2() // ************************************************************************* case "ACTION 3" // ************************************************************************* . . . // ************************************************************************* case else // **********************************************DAT**************************** //default action or error signalError(-1, "Unknow action '" + as_action + "' for ue_scanRow().") return -1 end choose */ return 0 end event public function boolean of_find (string as_find);//******************************************************************************** // // Object: n_ds_cache_base inherited from n_ds_conversion_base // Function: of_find // Access: public // Arguments: string as_find // Returns: booleDAT*an // Description: // Finds data in this datastore based on the find string. Sets the // internal row pointer (il_row) to the row found. // //******************************************************************************** // Revision History // Date Name Revision //-------------------------------------------------------------------------------- // 10/12/2000 Mark Young Initial Version //******************************************************************************** //findDAT*  the first row matching the find string long ll_row string ls_dataobject ls_dataobject = this.dataobject ll_row = this.rowCount() il_row = this.find(as_find, 1, ll_row) if il_row < 0 then is_find = "" signalError(il_row, "Data Object: " + is_dataObject + ". Find() failed. Find string '" + as_find + "'") return false end if //save the find string is_find = as_find if il_row > 0 then return true else return false end if end function public function boolean of_finDAT* dnext ();//******************************************************************************** // // Object: n_ds_cache_base inherited from n_ds_conversion_base // Function: of_findnext // Access: public // Arguments: none // Returns: boolean // Finds data in this datastore based on the find string. Sets the // internal row pointer (il_row) to the row found. // //******************************************************************************** // Revision History // DDAT*ate Name Revision //-------------------------------------------------------------------------------- // 10/12/2000 Mark Young Initial Version //******************************************************************************** //if of_find() wasn't called successfully, don't search if il_row <= 0 or is_find = "" then signalError(il_row, "Data Object: " + is_dataObject + ". A successful call to of_find() must be made before calling of_findNext()") return false end if //if we aDAT*re at the end of the buffer, don't search if il_row >= this.rowCount() then return false end if //find the next row matching the stored find string il_row = this.find(is_find, il_row + 1, this.rowCount()) if il_row < 0 then signalError(il_row, "Data Object: " + is_dataObject + ". FindNext() failed. Find string '" + is_find + "'") return false end if if il_row > 0 then return true else return false end if end function public function long of_getcount (string as_find)DAT*;//******************************************************************************** // // Object: n_ds_cache_base inherited from n_ds_conversion_base // Function: of_getcount // Access: public // Arguments: string as_find // Returns: long // Description: Loops through this datastore looking for the number of occurence by // criteria passed in as a parameter // //******************************************************************************** // Revision History DAT* // Date Name Revision //-------------------------------------------------------------------------------- // 10/23/2000 Michael Colombo Initial Version //******************************************************************************** long ll_rowfound, ll_rc, ll_foundcount ll_foundcount = 0 ll_rowfound = 0 ll_rc = this.rowcount() if ll_rc < 1 then return 0 end if //loops until rowfound > ll_rc DO ll_rowfound = this.find(as_find, ll_rowfound + 1, ll_rc ) if ll_DAT*rowfound > 0 then ll_foundcount++ //increments the found counter by one when there is a sucessful find else return ll_foundcount //exits out once there are no more finds end if LOOP UNTIL (ll_rowfound + 1) > ll_rc return ll_foundCount end function public function any of_getdata (string as_column);//******************************************************************************** // // Object: n_ds_cache_base inherited from n_ds_conversion_base // FunctionDAT*: of_getData // Access: public // Arguments: string as_column // Returns: any // Description: // Returns a data value from the row indicated // by internal row pointer il_row and column as_column. Il_row // is set by calling of_find() or of_findNext(). // //******************************************************************************** // Revision History // Date Name Revision //-------------------------------------------------------------------------------- // 07DAT*/28/2000 Mark Young Initial Version //******************************************************************************** string ls_type any as_data if il_row <= 0 or is_find = "" then signalError(il_row, "Data Object: " + is_dataObject + ". A successful call to of_find() must be made before calling of_getData()") return il_row end if as_column = trim(lower(as_column)) ls_type = this.describe(as_column + ".colType") choose case lower(left(ls_type, 5)) case "char(" /*char(n)DAT**/ as_data = this.getItemString(il_row, as_column) case "decim" /*decimal(n)*/, "int", "long", "numbe" /*number*/, "real", "ulong" as_data = this.getItemNumber(il_row, as_column) case "date" as_data = this.getItemDate(il_row, as_column) case "time" as_data = this.getItemTime(il_row, as_column) case "datet" /*datetime*/, "times" /*timestamp*/ as_data = this.getItemDateTime(il_row, as_column) case else signalError(-1, "Data Object: " + is_dataObject + ". Invalid column DAT*name '" + as_column + "', or unknown column data type '" + ls_type + "'") return -1 end choose return as_data end function public function long of_populate ();//******************************************************************************** // // Object: n_ds_cache_base inherited from n_ds_conversion_base // Function: of_populate // Access: public // Arguments: none // Returns: long // Description: triggers event ue_populate // //****************************DAT* **************************************************** // Revision History // Date Name Revision //-------------------------------------------------------------------------------- // 11/16/2000 Michael Colombo Initial Version //******************************************************************************** long ll_rc ll_rc = this.trigger event ue_populate() if ll_rc >= 0 then this.trigger event ue_populateEnd() end if return ll_rc end function public function integer DAT*"of_reset ();//******************************************************************************** // // Object: n_ds_cache_base inherited from n_ds_conversion_base // Function: of_reset // Access: public // Arguments: none // Returns: integer // Description: Wrapper for this.reset() // //******************************************************************************** // Revision History // Date Name Revision //--------------------------------------------------------DAT*$------------------------ // 10/13/2000 Mark Young Initial Version //******************************************************************************** return this.reset() end function public function long of_setdata (string as_column, any aa_data);//******************************************************************************** // // Object: n_ds_cache_base inherited from n_ds_conversion_base // Function: of_setdata // Access: public // Arguments: string as_column /DAT*&/ any aa_data // Returns: long // Description: // Sets a data value in this for the row indicated // by internal row pointer il_row and column as_column. Il_row // is set by calling of_find() or of_findNext(). // //******************************************************************************** // Revision History // Date Name Revision //-------------------------------------------------------------------------------- // 08/04/2000 Mark Young Initial Version //*******DAT*(************************************************************************* string ls_type long ll_rc if il_row <= 0 or is_find = "" then signalError(il_row, "Data Object: " + is_dataObject + ". A successful call to of_find() must be made before calling of_setData()") return il_row end if as_column = trim(lower(as_column)) ls_type = this.describe(as_column + ".colType") if ls_type = "?" or ls_type = "!" then signalError(-1, "Data Object: " + is_dataObject + ". Invalid coluDAT**mn name '" + as_column + "'") return -1 end if ll_rc = this.setItem(il_row, as_column, aa_data) if ll_rc < 0 then signalError(ll_rc, "Data Object: " + is_dataObject + ". Call to setItem() failed for column '" + as_column + "'") return -1 end if return 1 end function public function long of_setdataobject (string as_dataobject);//******************************************************************************** // // Object: n_ds_cache_base inherited from n_ds_conversion_baDAT*,se // Function: of_setdataobject // Access: public // Arguments: string as_dataobject // Returns: long // Description: Calls the function setTransObject // //******************************************************************************** // Revision History // Date Name Revision //-------------------------------------------------------------------------------- // 11/16/2000 Mark Young Initial Version //****************************************************************DAT*.**************** is_dataObject = trim(lower(as_dataObject)) this.dataObject = is_dataObject return this.setTransObject(sqlca) end function public function long of_scan (string as_action);//******************************************************************************** // // Object: n_ds_cache_base inherited from n_ds_conversion_base // Function: of_scan // Access: public // Arguments: string as_action // Returns: long (0 if whole buffer scanned; row number ifDAT*0 stopped on specific row) // Description: // Overloaded function without data argument. // Scans the datastore, calling ue_scanRow() on each row. // If ue_scanRow() returns null, then the scan stops on that row. // //******************************************************************************** // Revision History // Date Name Revision //-------------------------------------------------------------------------------- // 10/12/2000 Mark Young Initial Version //*****************DAT*2*************************************************************** any aa_data //set the data argument to null setNull(aa_data) //call the overloaded of_scan() function with all arguments return this.of_scan(as_action, aa_data) end function public function long of_scanreverse (string as_action);//******************************************************************************** // // Object: n_ds_cache_base inherited from n_ds_conversion_base // Function: of_scanReverse DAT*4 // Access: public // Arguments: string as_action // Returns: long (0 if whole buffer scanned; row number if stopped on specific row) // Description: // Overloaded function without data argument. // Scans the datastore backwards, calling ue_scanRow() on each row. // If ue_scanRow() returns null, then the scan stops on that row. // //******************************************************************************** // Revision History // Date Name Revision //-------------DAT*6------------------------------------------------------------------- // 10/12/2000 Mark Young Initial Version //******************************************************************************** any aa_data //set the data argument to null setNull(aa_data) //call the overloaded of_scanReverse() function with all arguments return this.of_scanReverse(as_action, aa_data) end function public function long of_scanreverse (string as_action, any aa_data);//****************************DAT*8**************************************************** // // Object: n_ds_cache_base inherited from n_ds_conversion_base // Function: of_scanReverse() // Access: public // Arguments: string as_action // any aa_data // Returns: long // 0 if whole buffer scanned // Row Number if stopped on specific row // < 0 if stopped on error // Description: // Scans the datastore backwards, calling ue_scanRow() on each row. // If ue_scanRow() returns null, tDAT*:hen the scan stops on that row. // If ue_scanRow() returns < 0, then the scan stops and returns negative value. // //******************************************************************************** // Revision History // Date Name Revision //-------------------------------------------------------------------------------- // 10/12/2000 Mark Young Initial Version //******************************************************************************** long ll_row long ll_rc, ll_rowcount DAT*< //trigger the begin scan event for any pre-processing this.trigger event ue_scanBegin() ll_rowcount = this.rowcount() //loop through datastore backwards for ll_row = ll_rowcount to 1 step -1 //call ue_scanRow() with requested action ll_rc = this.trigger event ue_scanRow(ll_row, as_action, aa_data) if ll_rc < 0 then //stop scan on error return ll_rc end if //if ue_scanRow() returns null, then stop on this row if isNull(ll_rc) then exit end if next DAT*> //trigger the end scan event for any post-processing this.trigger event ue_scanEnd() if ll_row < 1 then //whole buffer was scanned return 0 else //scan was stopped on a specific row return ll_row end if end function public function long of_scan (string as_action, any aa_data);//******************************************************************************** // // Object: n_ds_cache_base inherited from n_ds_conversion_base // Function: of_scan // Access: pDAT*@ublic // Arguments: string as_action // any aa_data // Returns: long // 0 if whole buffer scanned // Row Number if stopped on specific row // < 0 if stopped on error // Description: // Scans the datastore, calling ue_scanRow() on each row. // If ue_scanRow() returns null, then the scan stops on that row. // If ue_scanRow() returns < 0, then the scan stops and returns negative value. // //*******************************************************************DAT*B************* // Revision History // Date Name Revision //-------------------------------------------------------------------------------- // 10/12/2000 Mark Young Initial Version //******************************************************************************** long ll_row long ll_rowcount, ll_rc //trigger the begin scan event for any pre-processing this.trigger event ue_scanBegin() ll_rowcount = this.rowcount() //loop through datastore for ll_row = 1 to ll_rowcount /DAT*/call ue_scanRow() with requested action ll_rc = this.trigger event ue_scanRow(ll_row, as_action, aa_data) if ll_rc < 0 then //stop scan on error return ll_rc end if //if ue_scanRow() returns null, then stop on this row if isNull(ll_rc) then exit end if next //trigger the end scan event for any post-processing this.trigger event ue_scanEnd() if ll_row > ll_rowcount then //whole buffer was scanned return 0 else //scan was stopped on a specific row DAT*F si_countsnv_flusharraysw_exportsb_runsstr_recordcountsds_logfilen_cst_conversion_base P /,6P=/\h < +ue_synchronize+ue_initializeads_exportal_rowcountas_messageof_writelogmessagemidcountaw_exportof_setexportwindowab_runof_setrunof_synchronizeof_writelogmessageof_writelogmessageendof_wrDAT*itelogmessageerrorof_writelogmessagemidof_writelogmessagestartof_writelogtotalsof_writestatusmessageof_addtototalsadt_startadt_endof_elapsedtimeof_exportof_flushcacheof_getrunas_mainstringai_lengthas_padwithof_leftpadof_resettotalsanv_cacheobjectof_addtoflusharrayof_writelogmessagewarningof_initialize+create+destroy+constructor+destructor QI'2>ICn_ds_conversion_base.LSwdICw_export.IB >IDAT*Jn@@#An@n@ n@q@@a)@@q2`@`@a<j@j@aJk@k@Vl@l@jm@m@qv@@a@@@@Q@@!^@^@ u_dw_basedatawindowborderstyledwobjectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobject2 u_dw_base  +ue_scanend+ue_scanbeginaDAT*Ll_rowas_actionaa_data+ue_scanrowaa_arg1of_retrieveappendaa_arg2aa_arg3aa_arg4aa_arg5aa_arg6aa_arg7aa_arg8aa_arg9aa_arg10aa_arg11aa_arg12aa_arg13of_scanof_scanreverseD8 Qy")3LLSAtroGIAeGaiqyLAAAAAAAAAAAAA)3LSA)3)LDAT*NS) 8H (8 x _initsrcdatawindowu_dw_baseborderstyledwobjectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobject,Debuq!a@\@[@8&@U@!a2a@j@;k@@zE@m@!QSa!@@_@@s@^@aq ! @DAT*@ @@e @rue Co@3355 Te@  ( 2 W +ue_scanend+ue_scanbegin+ue_scanrowof_retrieveappendof_scanof_scanreverse"..@HH@DAT*Rionof_blockupdateof_resetblocksortkeysas_sortkeyof_addblocksortkeyof_getblocksortstringas_filterof_filteras_sortof_sortab_lockof_setfilterlockof_setsortlockai_indexof_getblocksortkeynameof_getblocksortkeynumberof_scanblocksadw_bufferab_orig_valueof_getitemanyas_operatoras_optionalvalueof_buildexpressionof_getcolumntypeof_populatecolumntypesof_trimdata  +create+destroysqldbcodesqlerrtextsqlsyntaxbufferrow+dberror+constructor+deDAT*TstructorphtP IL(4>HLLLSAg^ISIIyIASldICn_cst_conversion_base.tmp;;U]emu}LAAAAAAAAloISSICfileaccess.4IBSDAT*XjICsaveastype. SASHLA[]HAILASLB6|pIS[]id|U]emu}LS[]AAAAAAASSLLLRCtransaction.LSG[kBBkSI>HLSADAT*ing with error status) // Description: // This event is triggered by the of_scan() function, which loops through the // datastore and "visits" each row. This event is triggered once for each row // visited, processing can be done on a row by row basis. A case block is used to // determine what action to perform on each row (e.g. a function call or other // operation). Any data needed for row processing can be passed in via the aa_data // argument. If this event returns NULL, theDAT*ZALICdwbuffer.B^ALSCdwbuffer.Bc^ALSALI^ ALSSSd^ALSS^QteLLSSCdwbuffer.L DTdp?@1DAT*bd  1d  1Wd0 al_startrowal_endrowas_actionaa_dataP ( :F@@88z%)988$8&"18(z%8>z&+@+81PDAT*d1o@o88@P18Ez%8Yz&z&8hz&+@+811l)8)81"9}1}<<1@8}1 <1<"9}801<Yo@o8DAT*fz&1<R@8z(6)8<18(@(8z'8z&z&8z&z&8>z&+@+81b1!."X$~%&()@-P012569:;D=T>z?@BEFGH@IPJNPdQ as_columnls_typell_rcll_rowli_posli_ascls_datals_charlb_DAT*hmodified   '.5 = E .colTypedescribe`?!Invalid column name ''charInvalid data type '' for column ''; column must be of type 'char(n)'rowcountzgetitemstring setitemCall to setItem() failed for row , column ''; value = '     /DAT*j)8d  of_fileclose 1<$1 $/@/8<18$/@/818@h$z%+@+81p1x$1$/@/8<1$/@/818@$z%DAT*l+@+8111,Zj$&)+,2-B.f/48d ai_fileidll_rc(P il_masterhandle  il_temphandle( File close failed for is_masterfileW ( (  is_tempfile(   8 h p x      1DAT*n<$1  8$6:@P$:@:]@:@:8<X$1 p$/@/8x$8$z%+@+8$$1$6:@:@8@88<$1$/@/8$8$z%+@+8$1DAT*p,# &(()j*+,3d ai_fileidll_rc( il_masterhandle  is_masterfile (ie_fileaccess@  il_temphandle`  File open failed for ( ` ` is_tempfile`  ` `   8 P X p x      DAT*r     @8o@9888o(@(8z'8z&) 988("8o(@(8z'8)z&)4988<o(@(88z&)D988("o(@(88)z&)L9818T0+@+DAT*811o@o888@81R}8@8}<<Y}<<@8e@e811>RN j"#$)+,B-j.x01245d< aa_columnls_typeli_startli_endli_lengthcase23xDAT*vBase class for datastores used as export objectsforward global type n_ds_conversion_base from datastore end type end forward shared variables //A single call to of_setBasePathName() for an object of this type will //initialize ss_basePathName for all other instances of this data type //internal class instance counter integer si_count //base file path and name for temp file and master file string ss_exportPath = "?" string ss_basePathName = "?" //temporary file name constant DAT*xstring ss_tempFileName = "$conv.tmp" //master export object reference n_cst_conversion_base snv_export end variables global type n_ds_conversion_base from datastore event type integer ue_cleanup ( ) event type long ue_postblockupdate ( ) event type long ue_scanblock ( long al_startrow, long al_endrow, string as_action, any aa_data ) end type global n_ds_conversion_base n_ds_conversion_base type variables //master export object reference n_cst_conversion_base inv_export DAT*z //file variables for this export datastore string is_baseFileName //will override the name part of ss_basePathName if set string is_masterFile string is_tempFile string is_ext //set with of_setDataType() string is_dataObject = "?" //set with of_setDataType() string is_description //set with of_setFileDescription() long il_masterHandle = -1 long il_tempHandle = -1 fileAccess ie_fileAccess = write! //change with of_setFileAcces() saveAsType ie_DAT*|saveAsType = text! //change with of_setFileType() boolean ib_headings = false //change with of_setFileHeadings() boolean ib_keepFileOpen = false //change with of_setKeepFileOpen() boolean ib_loadBlankLines = false //change with of_setLoadBlankLines() //constants for internal file identification constant integer ii_master = 1 constant integer ii_temp = 2 //values populated by dbError event long il_error string is_error //record formatting error count long il_rowErrDAT*~or //lock sort and filter flags boolean ib_sortLock = false boolean ib_filterLock = false //block scanning control variables string is_blockSortKey[] //array of sort key columns for a block; format example "col_name A" //block update control variables (0 size means un-blocked update) long il_updateBlockSize = 1000 long il_updateModifiedCount = 0 long il_updateBlockCount = 0 long il_updateBlockNumber= 0 long il_updateBlockCommitCount = 0 long il_updateTotalCommitCount = 0 //DAT*array for saving column type for faster retrieval string is_columntypes[] //index matches column id call of_populatecolumntype end variables forward prototypes public function integer of_stripnonprintable (string as_column) public function integer of_fileclose () public function integer of_fileclose (integer ai_fileid) public function integer of_fileopen (integer ai_fileid) public function integer of_getdecimalfieldplace (any aa_column) public function string of_getfiledescription () pDAT*ublic function string of_getpathname () public function integer of_getstringfieldlength (any aa_column) public function integer of_loadfromfile (integer ai_sequence) public function integer of_register (n_cst_conversion_base anv_export) public function integer of_reset () public function integer of_retrieveappend (any aa_arg1) public function long of_retrieveappend (any aa_arg1, any aa_arg2, any aa_arg3, any aa_arg4, any aa_arg5, any aa_arg6, any aa_arg7, any aa_arg8) public function integeDAT*r of_savetofile (integer ai_sequence) public function integer of_setbasepathname (string as_exportpath, string as_basefilename) public function integer of_setdatatype (string as_ext, string as_dataobject) public function integer of_setfileaccess (fileaccess ae_fileaccess) public function integer of_setfiledescription (string as_description) public function integer of_setfileheadings (boolean ab_headings) public function integer of_setfilename (string as_name) public function integer of_setfDAT*iletype (saveastype ae_saveastype) public function integer of_setkeepfileopen (boolean ab_keepfileopen) public function integer of_getfieldlimit (any aa_column) public function string of_checkcase (any aa_column, string as_data) public function long of_addrowbase (any aa_data[]) public function any of_checkformat (integer ai_column, long al_row, any aa_data) public function string of_getrecordstring (long al_row) public function boolean of_fileexists () public function string of_getpath ()DAT* public function integer of_setloadblanklines (boolean ab_loadBlankLines) public function boolean of_basepathnameset () public function integer of_retrieveappend (string as_arg1[]) public function long of_retrieveappend (string as_arg1[], any aa_arg2, any aa_arg3, any aa_arg4, any aa_arg5, any aa_arg6, any aa_arg7, any aa_arg8) public function string of_parserecordstring (string as_recordstring) public function long of_setupdateblocksize (long al_updateblockSize) public function long of_bloDAT*ckupdate (ref transaction atr_transaction) public function long of_blockupdate () public function integer of_resetblocksortkeys () public function long of_addblocksortkey (string as_sortkey) public function string of_getblocksortstring () public function long of_filter (string as_filter) public function long of_sort (string as_sort) public function boolean of_setfilterlock (boolean ab_lock) public function boolean of_setsortlock (boolean ab_lock) public function string of_getblocksortkeynDAT*ame (integer ai_index) public function integer of_getblocksortkeynumber (integer ai_index) public function long of_scanblocks (string as_action, any aa_data) public function any of_getitemany (long al_row, integer ai_column, dwbuffer adw_buffer, boolean ab_orig_value) public function any of_getitemany (long al_row, string as_column, dwbuffer adw_buffer, boolean ab_orig_value) public function any of_getitemany (long al_row, string as_column) public function any of_getitemany (long al_row, intDAT*eger ai_column) public function any of_buildexpression (long al_row, string as_column, string as_operator, string as_optionalvalue) public function any of_buildexpression (long al_row, string as_column, string as_operator) public function any of_buildexpression (long al_row, string as_column) public function string of_getcolumntype (integer ai_column) public function long of_populatecolumntypes () public function any of_trimdata (long al_row, integer ai_column) end prototypes event ue_clDAT*eanup; //code any pre-save cleanup here //this event is triggered by of_saveToFile() before the save is performed. return 1 end event event ue_postblockupdate; //code any post-update functions here //this event is triggered by of_blockUpdate() after each block //of rows is updated and committed to the database. return 1 end event event ue_scanblock;//******************************************************************************** // // Object: n_ds_conversion_base // DAT* Event: ue_scanrow // Arguments: long al_startRow // long al_endRow // string as_action // any aa_data // Returns: long // (Return 0 to continue scanning the next block) // (Return NULL to stop the scanning process normally) // (Return value < 0 to stop the scanning with error status) // Description: // This event is triggered by the of_scanBlocks() function, which loops through the // datastore and "visits" each block of rows defined by the blDAT*ock sort keys. // This event is triggered once for each block visited. // Processing can be done on a block by block basis. A case block is used to // determine what action to perform on each block (e.g. a function call or other // operation). Any data needed for block processing can be passed in via the aa_data // argument. If this event returns NULL, the whole scan is stopped. // // NOTE: This event should be extended by descendant classes in order to // perform specific DAT*processing on the block given in al_startRow, al_endRow. // The as_action argument should be checked in a CASE block in order to determine what // action should be performed. // //******************************************************************************** // Revision History // Date Name Revision //-------------------------------------------------------------------------------- // 05/22/2002 Mark Young Initial Version //*******************************************************DAT************************** //EXTEND this script as follows //DO NOT place code here in the base class unless it will apply to all //objects of this class and its descendants //EXAMPLE: /* //Return NULL to stop the scanning process normally //(of_scanBlock() will return the row stopped on) //Return Negative Value to stop the scanning process with error status //(of_scanBlock() will return the Negative Value) //force argument to upper case as_action = upper(trim(as_action)) DAT* choose case as_action // ************************************************************************* case "ACTION 1" // ************************************************************************* function_1(aa_data) // ************************************************************************* case "ACTION 2" // ************************************************************************* function_2() // **************************************************************DAT************ case "ACTION 3" // ************************************************************************* . . . // ************************************************************************* case else // ************************************************************************* //default action or error signalError(-1, "Unknow action '" + as_action + "' for ue_scanBlock().") return -1 end choose */ return 0 end event public function integer of_stripnonprinDAT*table (string as_column);//******************************************************************************** // // Object: n_ds_conversion_base inherited from datastore // Function: of_stripnonprintable // Access: public // Arguments: string as_column // Returns: integer // Description: Remove non-printable characters from a given column; replaces // non-printable characters with a space character // //***************************************************************DAT****************** // Revision History // Date Name Revision //-------------------------------------------------------------------------------- // 08/18/2000 Mark Young Initial Version //******************************************************************************** string ls_type long ll_rc long ll_row integer li_pos integer li_asc string ls_data string ls_char boolean lb_modified setPointer(hourglass!) as_column = trim(lower(as_column)) //grab the data type of the DAT*column ls_type = this.describe(as_column + ".colType") if ls_type = "?" or ls_type = "!" then //if the column is not found, then signal error signalError(-1, "Invalid column name '" + as_column + "'") return -1 elseif lower(left(ls_type, 4)) <> "char" then //if this is not a character column, then signal error signalError(-1, "Invalid data type '" + ls_type + "' for column '" + as_column + "'; column must be of type 'char(n)'") return -1 end if //loop through the datastore and DAT*remove non-printable characters for ll_row = 1 to this.rowCount() //read the data value ls_data = this.getItemString(ll_row, as_column) if isNull(ls_data) or len(ls_data) = 0 then continue end if lb_modified = false ls_data = trim(ls_data) //process the string, removing non-printable characters for li_pos = 1 to len(ls_data) ls_char = mid(ls_data, li_pos, 1) li_asc = asc(ls_char) //replace non printable characters with a space if li_asc < 32 or li_asc > 127DAT* then lb_modified = true ls_char = " " ls_data = left(ls_data, li_pos - 1) + ls_char + mid(ls_data, li_pos + 1) end if next //if modified, store the modified value back into the datastore if lb_modified then ls_data = trim(ls_data) ll_rc = this.setItem(ll_row, as_column, ls_data) if ll_rc < 0 then signalError(ll_rc, "Call to setItem() failed for row " + string(ll_row) + ", column '" + as_column + "'; value = '" + ls_data + "'") return -1 end if end if DAT* next return 1 end function public function integer of_fileclose ();//******************************************************************************** // // Object: n_ds_conversion_base inherited from datastore // Function: of_fileClose // Access: public // Arguments: none // Returns: integer // Description: Closes the master file // //******************************************************************************** // Revision History // Date Name RevisiDAT*on //-------------------------------------------------------------------------------- // 10/13/2000 Mark Young Initial Version //******************************************************************************** return this.of_fileClose(ii_master) end function public function integer of_fileclose (integer ai_fileid);//******************************************************************************** // // Object: n_ds_conversion_base inherited from datastore // Function: of_fileCDAT*lose // Access: public // Arguments: integer ai_fileID ( <= 1 for master file; > 1 for temp file // Returns: integer // Description: // Closes the specified file if it's open and maintains the internal file handle. // If an error occurrs, close is attempted for both the master and temp files // //******************************************************************************** // Revision History // Date Name Revision //---------------------------------------------------DAT*----------------------------- // 10/12/2000 Mark Young Initial Version //******************************************************************************** long ll_rc if ai_fileID <= 1 then //close master file if it's open if il_masterHandle > 0 then ll_rc = fileClose(il_masterHandle) if ll_rc < 0 then fileClose(il_tempHandle) signalError(-1, "File close failed for " + is_masterFile) return -1 end if end if il_masterHandle = -1 else //clDAT*ose temp file if it's open if il_tempHandle > 0 then ll_rc = fileClose(il_tempHandle) if ll_rc < 0 then fileClose(il_masterHandle) signalError(-1, "File close failed for " + is_tempFile) return -1 end if end if il_tempHandle = -1 end if return 1 end function public function integer of_fileopen (integer ai_fileid);//******************************************************************************** // // Object: n_ds_conversion_base inheriteDAT*d from datastore // Function: of_fileopen // Access: public // Arguments: integer ai_fileid // Returns: integer // Description: // Opens the specified file if it's closed and maintains the internal file handle // //******************************************************************************** // Revision History // Date Name Revision //-------------------------------------------------------------------------------- // 10/12/2000 Mark Young Initial Version //*****DAT**************************************************************************** long ll_rc if ai_fileID <= 1 then //open master file if it's closed if il_masterHandle < 0 then il_masterHandle = fileOpen(is_masterFile, lineMode!, ie_fileAccess, lockWrite!, append!) if il_masterHandle < 0 then fileClose(il_tempHandle) signalError(il_masterHandle, "File open failed for " + is_masterFile) return il_masterHandle end if end if else //open temp file if iDAT*t's closed if il_tempHandle < 0 then il_tempHandle = fileOpen(is_tempFile, lineMode!, read!) if il_tempHandle < 0 then fileClose(il_masterHandle) signalError(il_tempHandle, "File open failed for " + is_tempFile) return il_tempHandle end if end if end if return 1 end function public function integer of_getdecimalfieldplace (any aa_column);//******************************************************************************** // // Object: n_ds_convDAT*ersion_base inherited from datastore // Function: of_getdecimalfieldplace // Access: public // Arguments: integer ai_column // Returns: integer // Description: Gets decimal place from decimal field of current datawindow // //******************************************************************************** // Revision History // Date Name Revision //-------------------------------------------------------------------------------- // 10/18/2000 Michael Colombo Initial VerDAT*sion //******************************************************************************** string ls_type integer li_start, li_end, li_length setnull(ls_type) //get column type CHOOSE CASE ClassName(aa_column) CASE "integer" ls_type = this.Describe("#"+string(aa_column)+".tag") if ls_type = '' or isnull(ls_type) then ls_type = this.Describe("#"+string(aa_column)+".coltype") end if CASE "string" ls_type = this.Describe(string(aa_column)+".tag") if ls_type = '' or iDAT*snull(ls_type) then ls_type = this.Describe(string(aa_column)+".coltype") end if case else signalerror(-1, "Argument ~'aa_column~' was not an integer or string") return 0 end Choose //if column type is decimal get decimal place else return 0 if lower(left(ls_type, 7)) = 'decimal' then //strip of parenthesis from string to get number ie... "(23)" li_start = pos(ls_type, '(') + 1 li_end = pos(ls_type, ')') if li_end > li_start then li_length = li_end - li_start DAT* //return decimal place return integer(mid(ls_type, li_start, li_length)) else return 0 end if else return 0 end if end function public function string of_getfiledescription (); return is_description end function public function string of_getpathname ();//******************************************************************************** // // Object: n_ds_conversion_base inherited from datastore // Function: of_getpathname // Access: public // ADAT*rguments: none // Returns: string // Description: Sets and returns the internal path and file name variable is_masterFile // //******************************************************************************** // Revision History // Date Name Revision //-------------------------------------------------------------------------------- // 10/17/2000 Mark Young Initial Version //******************************************************************************** //check for base path DAT*and file name previously set if ss_basePathName = "?" then signalError(-1, "Must call of_setBasePathName() prior to calling of_getPathName()") return ss_basePathName end if //set the master export file name if is_baseFileName <> "" then is_masterFile = ss_exportPath + is_baseFileName + "." + is_ext else is_masterFile = ss_basePathName + "." + is_ext end if return is_masterFile end function public function integer of_getstringfieldlength (any aa_column);//********************DAT************************************************************* // // Object: n_ds_conversion_base inherited from datastore // Function: of_getstringfieldlength // Access: public // Arguments: integer ai_column // Returns: integer // Description: Get field length // //******************************************************************************** // Revision History // Date Name Revision //---------------------------------------------------------------------------DAT*----- // 10/18/2000 Michael Colombo Initial Version //******************************************************************************** string ls_type integer li_start, li_end, li_length //get column type CHOOSE CASE ClassName(aa_column) CASE "integer" ls_type = this.Describe("#"+string(aa_column)+".coltype") CASE "string" ls_type = this.Describe(string(aa_column)+".coltype") case else signalerror(-1, "Argument was not an integer or string") return 0 end Choose DAT* //if column type is char get string length else return 0 if lower(left(ls_type, 5)) = 'char(' then //strip of parenthesis from string to get number ie... "(23)" li_start = pos(ls_type, '(') + 1 li_end = pos(ls_type, ')') if li_end > li_start then li_length = li_end - li_start //return string length return integer(mid(ls_type, li_start, li_length)) else return 0 end if else return 0 end if end function public function integer of_loadfromfile (integeDAT*r ai_sequence);//******************************************************************************** // // Object: n_ds_conversion_base inherited from datastore // Function: of_loadFromfile // Access: public // Arguments: integer ai_sequence (<=1 for overwrite; >1 for append) // Returns: integer // Description: // Loads data from file identified by is_masterFile. // If as_sequence is <= 1 the data store is reset before the data is loaded; // otherwise, data is appenDAT*ded to the existing data set // //******************************************************************************** // Revision History // Date Name Revision //-------------------------------------------------------------------------------- // 10/12/2000 Mark Young Initial Version //******************************************************************************** long ll_rc long ll_row string ls_data datastore lds_temp setPointer(hourGlass!) //set the master export file namDAT*e is_masterFile = this.of_getPathName() //validate that file exists if not fileExists(is_masterFile) then signalError(-1 , "File " + is_masterFile + " does not exist.") return -1 end if //verify that we have a text file if ie_saveAsType <> text! then signalError(-1, "Cannot load data from a non-text file type") return -1 end if //verify that we can read the file if ie_fileAccess <> read! then signalError(-1, "Cannot load data when file access mode = write!.") return -1 DAT*end if //check for append/overwrite if ai_sequence <= 1 then this.reset() end if //create temp datastore lds_temp = create datastore if not isValid(lds_temp) then signalError(-1, "Failed creating datastore lds_temp") return -1 end if lds_temp.dataObject = this.dataObject //open the master file if this.of_fileOpen(ii_master) < 0 then return -1 end if //load the data from the master file into lds_temp do while true ll_row ++ //read data from the master file DAT*ll_rc = fileRead(il_masterHandle, ls_data) if ll_rc = -100 then exit //EOF condition elseif ll_rc = 0 then //no data on current line if ib_loadBlankLines then lds_temp.insertRow(0) end if continue elseif ll_rc = -1 then fileClose(il_masterHandle) fileClose(il_tempHandle) signalError(-1, "File read failed for " + is_masterFile + "; line " + string(ll_row)) return -1 end if //import data into temp datastore (inserts data at the end of buffer) ll_rc = ldDAT*s_temp.importString(ls_data) choose case ll_rc case -1 //Data row out of range fileClose(il_masterHandle) fileClose(il_tempHandle) signalError(ll_rc, "Data row out of range; line " + string(ll_row)) return ll_rc case -3, -4 //Invalid argument fileClose(il_masterHandle) fileClose(il_tempHandle) signalError(ll_rc, "Invalid data from file; line " + string(ll_row)) return ll_rc case -9 //The user canceled the import on validation error endDAT* choose loop //copy the data from the temp datastore into the main datastore ll_rc = lds_temp.rowsCopy(1, lds_temp.rowCount(), primary!, & this, this.rowCount() + 1, primary!) if ll_rc < 0 then fileClose(il_masterHandle) fileClose(il_tempHandle) signalError(-1, "Rows copy failed; line " + string(ll_row)) return -1 end if if isValid(lds_temp) then destroy lds_temp end if //open or close master file based on ib_keepFileOpen flag if ib_keepFileOpen and ie_saveAsDAT*Type = text! then if this.of_fileOpen(ii_master) < 0 then return -1 end if else if this.of_fileClose(ii_master) < 0 then return -1 end if end if return 1 end function public function integer of_register (n_cst_conversion_base anv_export);//******************************************************************************** // // Object: n_ds_conversion_base inherited from datastore // Function: of_register // Access: public // Arguments: n_cst_coDAT*nversion_base anv_export // Returns: integer // Description: Set master export object references (shared and instance) // //******************************************************************************** // Revision History // Date Name Revision //-------------------------------------------------------------------------------- // 11/16/2000 Mark Young Initial Version //******************************************************************************** snv_export = anv_export invDAT*_export = anv_export if not isValid(inv_export) then signalError(-1, "Failed initializing inv_export") return -1 end if return 1 end function public function integer of_reset ();//******************************************************************************** // // Object: n_ds_conversion_base inherited from datastore // Function: of_reset // Access: public // Arguments: none // Returns: integer // Description: Resets the datastore and sets the error counterDAT* to 0 // //******************************************************************************** // Revision History // Date Name Revision //-------------------------------------------------------------------------------- // 10/19/2000 Mark Young Initial Version //******************************************************************************** this.reset() il_rowError = 0 return 1 end function public function integer of_retrieveappend (any aa_arg1);//*************************DAT******************************************************** // // Object: n_ds_conversion_base inherited from datastore // Function: of_retrieveappend // Access: public // Arguments: any aa_arg1 // Returns: integer // Description: Overload the main of_retrieveAppend() function which takes 8 arguments // //******************************************************************************** // Revision History // Date Name Revision //---------------------------------------DAT*----------------------------------------- // 11/16/2000 Mark Young Initial Version //******************************************************************************** //overload the main of_retrieveAppend() function which takes 8 arguments long ll_rc any la_null setNull(la_null) ll_rc = this.of_retrieveAppend(aa_arg1, la_null, la_null, la_null, la_null, la_null, la_null, la_null) return ll_rc end function public function long of_retrieveappend (any aa_arg1, any aa_arg2, anyDAT* aa_arg3, any aa_arg4, any aa_arg5, any aa_arg6, any aa_arg7, any aa_arg8);//******************************************************************************** // // Object: n_ds_conversion_base inherited from datastore // Function: of_retrieveappend // Access: public // Arguments: any aa_arg1 // any aa_arg2 // any aa_arg3 // any aa_arg4 // any aa_arg5 // any aa_arg6 // any aa_arg7 // any aa_arg8 // Returns: long // Description: /DAT*/ Retrieve data and append to this datastore. Will accept up to 8 retrieval // arguments. // //******************************************************************************** // Revision History // Date Name Revision //-------------------------------------------------------------------------------- // 10/26/2000 Mark Young Initial Version //******************************************************************************** long ll_rc long ll_rows datastore lds_temp if this.DAT*rowCount() > 0 then //we already have rows, so use temp datastore to get //the next set of rows and append //create the temp datastore lds_temp = create datastore if not isValid(lds_temp) then signalError(-1, "Failed creating ids_temp") return -1 end if lds_temp.dataObject = this.dataObject //grab a copy of the current transaction object //and give it to the temp datastore //messageBox("Development", "Fix copy trans functionality to non-pfc") //will need to adDAT*d pfc-like instance transaction reference and of_setTransObject function ll_rc = lds_temp.setTransObject(sqlca) if ll_rc < 0 then destroy lds_temp signalError(ll_rc, "SetTransObject() failed for lds_temp. DataObject = " + string(lds_temp.dataObject)) return -1 end if //retrieve the temp datastore ll_rows = lds_temp.retrieve(aa_arg1, aa_arg2, aa_arg3, aa_arg4, aa_arg5, aa_arg6, aa_arg7, aa_arg8) if ll_rows < 0 then destroy lds_temp signalError(ll_rows, "Retrieve() faiDAT*led for lds_temp") return -1 end if //append the temp rows to the main datastore if ll_rows > 0 then ll_rc = lds_temp.rowsCopy(1, ll_rows, primary!, this, this.rowCount() + 1, primary!) if ll_rc < 0 then destroy lds_temp signalError(ll_rc, "RowsCopy() failed for lds_temp") return -1 end if end if if isValid(lds_temp) then destroy lds_temp end if else //we have no rows yet, so retrieve this datastore directly ll_rows = this.retrieve(aa_arg1, aDAT*a_arg2, aa_arg3, aa_arg4, aa_arg5, aa_arg6, aa_arg7, aa_arg8) if ll_rows < 0 then signalError(ll_rows, "Retrieve() failed") return -1 end if end if return ll_rows end function public function integer of_savetofile (integer ai_sequence);//******************************************************************************** // // Object: n_ds_conversion_base inherited from datastore // Function: of_savetofile // Access: public // Arguments: integer ai_sequence (<=DAT*1 for overwrite; >1 for append) // Returns: integer // Description: // Saves current data to file identified by is_masterFile. // If as_sequence is <= 1 saveAs() is called to create/overwirte the file; // otherwise, data is saved to a temporary file and then appended to the // master file. // //******************************************************************************** // Revision History // Date Name Revision //------------------------------------------------------DAT*-------------------------- // 10/12/2000 Mark Young Initial Version //******************************************************************************** long ll_rc long ll_row string ls_data setPointer(hourGlass!) //set the master export file name is_masterFile = this.of_getPathName() //set the temp file name is_tempFile = ss_exportPath + ss_tempFileName //do any pre-save cleanup this.trigger event ue_cleanup() //save data to file if ai_sequence <= 1 or not fileExists(isDAT*_masterFile) then //save data directly to master file (overwrite) //close master file if it's already open if this.of_fileClose(ii_master) < 0 then return -1 end if ll_rc = this.saveAs(is_masterFile, ie_saveAsType, ib_headings) if ll_rc < 0 then signalError(-1, "File save failed for " + is_masterFile) return -1 end if else //append data to master file //verify that we have a text file if ie_saveAsType <> text! then signalError(-1, "Cannot append data toDAT* a non-text file type") return -1 end if //close temp file if it's already open if this.of_fileClose(ii_temp) < 0 then return -1 end if //save data to temp file ll_rc = this.saveAs(is_tempFile, ie_saveAsType, false) //no column headings for append if ll_rc < 0 then fileClose(il_masterHandle) signalError(-1, "File save failed for " + is_tempFile) return -1 end if //open the master file if this.of_fileOpen(ii_master) < 0 then return -1 end if //oDAT*pen the temp file if this.of_fileOpen(ii_temp) < 0 then return -1 end if //read the data from the temp file and write it to the master file do while true ll_row ++ //read data from the temp file ll_rc = fileRead(il_tempHandle, ls_data) if ll_rc = -100 then exit //EOF condition elseif ll_rc = 0 then continue //no data on current line elseif ll_rc = -1 then fileClose(il_masterHandle) fileClose(il_tempHandle) signalError(-1, "File read faileDAT*d for " + is_tempFile + "; line " + string(ll_row)) return -1 end if //write data to the master file ll_rc = fileWrite(il_masterHandle, ls_data) if ll_rc = -1 then fileClose(il_masterHandle) fileClose(il_tempHandle) signalError(-1, "File write failed for " + is_masterFile + "; temp file line " + string(ll_row)) return -1 end if loop //close the temp file if this.of_fileClose(ii_temp) < 0 then return -1 end if end if //open or close maDAT*ster file based on ib_keepFileOpen flag if ib_keepFileOpen and ie_saveAsType = text! then if this.of_fileOpen(ii_master) < 0 then return -1 end if else if this.of_fileClose(ii_master) < 0 then return -1 end if end if //add information about this object to the export object's totals array if isValid(inv_export) then inv_export.of_addToTotals(this) else return 1 end if return 1 end function public function integer of_setbasepathname (string as_exportpathDAT*, string as_basefilename);//******************************************************************************** // // Object: n_ds_conversion_base inherited from datastore // Function: of_setbasepathname // Access: public // Arguments: string as_exportPath // string as_baseFileName // Returns: integer // Description: // Sets the shared variable ss_basePathName to the // export folder and base file name (no extension) // //****************************************DAT***************************************** // Revision History // Date Name Revision //---------------------------------------------------------------------