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 //-------------------------------------------------------------------------------- // 10/12/2000 Mark Young Initial Version //******************************************************************************** string ls_basePathName //force file names to lower case ss_exportPath = trim(lower(as_exportPath)) if right(as_exportPath, 1) <> "\" then ss_exportPath = ss_exportPath + "\" end if sDAT*s_basePathName = ss_exportPath + trim(lower(as_baseFileName)) return 1 end function public function integer of_setdatatype (string as_ext, string as_dataobject);//******************************************************************************** // // Object: n_ds_conversion_base inherited from datastore // Function: of_setdatatype // Access: public // Arguments: string as_ext // string as_dataobject // Returns: integer // Description: Set the remaining file reDAT*lated values and set the data object // //******************************************************************************** // Revision History // Date Name Revision //-------------------------------------------------------------------------------- // 10/12/2000 Mark Young Initial Version //******************************************************************************** long ll_rc //check for file already open if il_masterHandle > 0 then signalError(-1, "File already open " +DAT* is_masterFile) return -1 end if //set the file extension is_ext = trim(lower(as_ext)) //set the data object is_dataObject = trim(lower(as_dataObject)) this.dataObject = is_dataObject //set the transaction object //(if sqlca is not correct, call setTransObject() after calling this function) ll_rc = this.setTransObject(sqlca) if ll_rc < 0 then signalError(ll_rc, "SetTransObject() failed. DataObject = " + as_dataObject) return -1 end if return 1 end function public fuDAT*nction integer of_setfileaccess (fileaccess ae_fileaccess);//******************************************************************************** // // Object: n_ds_conversion_base inherited from datastore // Function: of_setfileaccess // Access: public // Arguments: fileaccess ae_fileaccess // Returns: integer // Description: The default access mode is write! if this function is not called to override // //*******************************************************************DAT* ************* // Revision History // Date Name Revision //-------------------------------------------------------------------------------- // 11/16/2000 Mark Young Initial Version //******************************************************************************** ie_fileAccess = ae_fileAccess return 1 end function public function integer of_setfiledescription (string as_description);//******************************************************************************** // // ODAT* bject: n_ds_conversion_base inherited from datastore // Function: of_setfiledescription // Access: public // Arguments: string as_description // Returns: integer // Description: Initilizes instance variable is_description // //******************************************************************************** // Revision History // Date Name Revision //-------------------------------------------------------------------------------- // 11/16/2000 Mark Young Initial VersioDAT*n //******************************************************************************** this.is_description = as_description return 1 end function public function integer of_setfileheadings (boolean ab_headings);//******************************************************************************** // // Object: n_ds_conversion_base inherited from datastore // Function: of_setfileheadings // Access: public // Arguments: boolean ab_headings // Returns: integer // DescDAT*ription: The default setting for file headings is false if this function // is not called to override // //******************************************************************************** // Revision History // Date Name Revision //-------------------------------------------------------------------------------- // 11/16/2000 Mark Young Initial Version //******************************************************************************** ib_headings = ab_headings return 1 endDAT* function public function integer of_setfilename (string as_name);//******************************************************************************** // // Object: n_ds_conversion_base inherited from datastore // Function: of_setfileName // Access: public // Arguments: string as_name // Returns: integer // Description: // This function sets a file name (no path, no extension) which will override // the name portion of ss_basePathName // // //***************DAT****************************************************************** // Revision History // Date Name Revision //-------------------------------------------------------------------------------- // 10/13/2000 Mark Young Initial Version //******************************************************************************** //check for file already open if il_masterHandle > 0 then signalError(-1, "File already open " + is_masterFile) return -1 end if is_basefilename = trim(lower(as_naDAT*me)) //reset the internal full path and file name string, is_masterFile is_masterFile = this.of_getPathName() return 1 end function public function integer of_setfiletype (saveastype ae_saveastype);//******************************************************************************** // // Object: n_ds_conversion_base inherited from datastore // Function: of_setfiletype // Access: public // Arguments: saveastype ae_saveastype // Returns: integer // Description: TheDAT* default file type is text! if this function is not called // to override // //******************************************************************************** // Revision History // Date Name Revision //-------------------------------------------------------------------------------- // 11/16/2000 Mark Young Initial Version //******************************************************************************** ie_saveAsType = ae_saveAsType return 1 end function public functDAT*ion integer of_setkeepfileopen (boolean ab_keepfileopen);//******************************************************************************** // // Object: n_ds_conversion_base inherited from datastore // Function: of_setkeepfileopen // Access: public // Arguments: boolean ab_keepfileopen // Returns: integer // Description: The default setting for keep file open is false if this function // is not called to override // //*********************************************DAT************************************ // Revision History // Date Name Revision //-------------------------------------------------------------------------------- // 11/16/2000 Michael Colombo Initial Version //******************************************************************************** ib_keepFileOpen = ab_keepFileOpen return 1 end function public function integer of_getfieldlimit (any aa_column);//***************************************************************************DAT****** // // Object: n_ds_conversion_base inherited from datastore // Function: of_getfieldlimit // Access: public // Arguments: any aa_column // Returns: integer // Description: Checks the field edit property for upper and lower case. Then changes // the text in the field accordingly. // //******************************************************************************** // Revision History // Date Name Revision //------------------------------------------DAT* -------------------------------------- // 10/17/2000 Michael Colombo Initial Version //******************************************************************************** string ls_limit //get column type CHOOSE CASE ClassName(aa_column) CASE "integer" ls_limit = this.describe("#"+string(aa_column) + ".edit.limit") CASE "string" ls_limit = this.describe(string(aa_column) + ".edit.limit") case else signalerror(-1, "Argument ~'aa_column~' was not an integer or string") return DAT*"-1 end Choose return integer(ls_limit) end function public function string of_checkcase (any aa_column, string as_data);//******************************************************************************** // // Object: n_ds_conversion_base inherited from datastore // Subroutine: of_checkcase // Access: public // Arguments: long al_row // integer ai_column // Returns: none // Description: Checks the field edit property for upper and lower case. Then chDAT*$anges // the text in the field accordingly. // //******************************************************************************** // Revision History // Date Name Revision //-------------------------------------------------------------------------------- // 10/17/2000 Michael Colombo Initial Version //******************************************************************************** string ls_case setnull(ls_case) //get column type CHOOSE CASE ClassName(aa_column) CASE "intDAT*&eger" ls_case = this.describe("#"+string(aa_column) + ".edit.case") CASE "string" ls_case = this.describe(string(aa_column) + ".edit.case") case else signalerror(-1, "Argument ~'aa_column~' was not an integer or string") return as_data end Choose choose case ls_case case 'upper' return upper(as_data) case 'lower' return lower(as_data) case else return as_data end choose end function public function long of_addrowbase (any aa_data[]);//***************DAT*(***************************************************************** // // Object: n_ds_conversion_base inherited from datastore // Function: of_addrowbase // Access: public // Arguments: any aa_data[] // Returns: long // Description: Does a format check on the fields corresponding to the export // datawindow column properties // //******************************************************************************** // Revision History // Date Name Revision //----DAT**---------------------------------------------------------------------------- // 11/16/2000 Michael Colombo Initial Version //******************************************************************************** long ll_rc long ll_row integer li_colCount, li_col any aa_dataItem ll_row = this.insertrow(0) if ll_row < 0 then inv_export.of_writeLogMessageError(this, "InsertRow() failed.") return -1 end if if ll_row > 0 then //get count of number of columns in datawindow li_colCDAT*,ount = integer(this.object.datawindow.column.count) if li_colcount > 0 then //loops through the columns for li_col = 1 to li_colcount aa_dataItem = of_checkformat(li_col, ll_row, aa_data[li_col]) if isnull(aa_dataItem) then continue end if ll_rc = this.setitem(ll_row, li_col, aa_dataItem) if ll_rc < 0 then inv_export.of_writeLogMessageError(this, "Failed writing data value to column: " + this.Describe("#"+string(li_col)+".name")) end if next DAT*.end if end if return ll_row end function public function any of_checkformat (integer ai_column, long al_row, any aa_data);////******************************************************************************** //// //// Object: n_ds_conversion_base inherited from datastore //// Subroutine: of_checkformat //// Access: public //// Arguments: long al_row //// Returns: none //// Description: Loops through all the columns in a datawindow and passes them to //// otheDAT*0r procedures that reformat the data according to export //// export specifications. //// ////******************************************************************************** //// Revision History //// Date Name Revision ////-------------------------------------------------------------------------------- //// 10/17/2000 Michael Colombo Initial Version //// 02/10/2004 Michael Colombo Uses get column type function ////***********************************************************DAT*2********************* string ls_type, ls_columnName, ls_data integer li_decimalplace, li_fieldlength, li_fieldlimit, li_position setnull(ls_type) ls_columnName = this.Describe("#"+string(ai_column)+".name") ls_type = this.Describe("#"+string(ai_column)+".tag") if ls_type = '' or ls_type = '?' or isnull(ls_type) then ls_type = this.of_getcolumntype(ai_column) //ls_type = this.Describe("#"+string(ai_column)+".coltype") end if ls_data = string(aa_data) if ls_data = "" then setNull(DAT*4aa_data) end if if isnull(inv_export.is_errorMessage) then inv_export.is_errorMessage = '' end if if not isnull(aa_data) then choose case lower(left(ls_type, 5)) case "char(" /*char(n)*/ li_fieldlength = of_getstringfieldlength(ai_column) ls_data = trim(ls_data) if li_fieldlength < len(ls_data) then inv_export.of_writeLogMessageWarning(this, "row " + & string(al_row) + " field name: " + lower(ls_columnName) + & " (" + ls_datDAT*6a + "). Length was greater than " + string(li_fieldlength) + & ". Value was trimmed. " + inv_export.is_errorMessage) ls_data = left(ls_data, li_fieldlength) end if aa_data = of_checkcase(ai_column, ls_data) case "decim" /*decimal(n)*/ if lower(ClassName(aa_data)) = 'decimal' then li_decimalplace = of_getdecimalfieldplace(ai_column) li_fieldLimit = of_getfieldlimit(ai_column) if li_decimalplace > 0 then aa_data = round(dec(ls_DAT*8data), li_decimalplace) end if ls_data = string(aa_data) //check length of the number against import specs li_position = pos(ls_data, ".") - 1 //if (li_fieldLimit - li_decimalplace) < li_position then if li_fieldlimit < len(ls_data) then if li_position < li_fieldlimit and li_position > 0 and li_fieldlimit > 0 and li_decimalplace = 0 then aa_data = round(dec(ls_data), (li_fieldLimit - li_position)) elseif ((li_position = li_fieldlimiDAT*:t) or (li_position = (li_fieldlimit + 1)) ) and (li_position > 0 and li_fieldlimit > 0 and li_decimalplace = 0) then aa_data = dec(left(string(round(dec(ls_data), 0 )), li_fieldlimit)) else inv_export.of_writeLogMessageError(this, "row " + & string(al_row) + " field name: " + lower(ls_columnName) + & " (" + ls_data + "). Length was greater than " + string(li_fieldlimit) + & ". Value set to 0. " + inv_export.is_errorMessage) DAT*< aa_data = 0 end if end if else inv_export.of_writeLogMessageError(this, "row " + string(al_row) + & " field name: " + lower(ls_columnName) + & " (" + ls_data + ") was not a decimal. Value set to null. " + inv_export.is_errorMessage) setnull(aa_data) end if case "int", "long", "numbe", /*number*/ "ulong" if isnumber(ls_data) then li_fieldlimit = of_getfieldlimit(ai_column) if li_fieldlimDAT*>it < len(ls_data) and li_fieldlimit <> 0 then inv_export.of_writeLogMessageError(this, "row " + & string(al_row) + " field name: " + lower(ls_columnName) + & " (" + ls_data + ") was not <= to limit " + string(li_fieldlimit) + & ". Value set to null. " + inv_export.is_errorMessage) setnull(aa_data) end if else inv_export.of_writeLogMessageError(this, "row " + & string(al_row) + " field name: " + lower(lDAT*@s_columnName) + & " (" + ls_data + ") was not a number. Value set to null. " + inv_export.is_errorMessage) setnull(aa_data) end if case "real" if lower(ClassName(aa_data)) <> 'real' then inv_export.of_writeLogMessageError(this, + "row " + & string(al_row) + " field name: " + lower(ls_columnName) + & " (" + ls_data + ") was not a real number. Value set to null. " + inv_export.is_errorMessage) setnull(aa_data) DAT*B end if case "date" if isdate(ls_data) or isNull(ls_data) then //aa_data = date(ls_data) aa_data = string(date(ls_data), "yyyymmdd") //for net importer else inv_export.of_writeLogMessageError(this, + "row " + & string(al_row) + " field name: " + lower(ls_columnName) + & " (" + ls_data + ") was not a date. Value set to null. " + inv_export.is_errorMessage) setnull(aa_data) end if case "time" if istime(ls_datDAT*Da) then //aa_data = time(ls_data) aa_data = string(time(ls_data), "hhmm") //for net importer else inv_export.of_writeLogMessageError(this, + "row " + & string(al_row) + " field name: " + lower(ls_columnName) + & " (" + ls_data + ") was not a time. Value set to null. " + inv_export.is_errorMessage) setnull(aa_data) end if case "datet" /*datetime*/, "times" /*timestamp*/ if isdate(ls_data) then aa_data = datetime(date(ls_DAT*Fdata)) else inv_export.of_writeLogMessageError(this, + "row " + & string(al_row) + " field name: " + lower(ls_columnName) + & " (" + ls_data + ") was not a datetime. Value set to null. " + inv_export.is_errorMessage) setnull(aa_data) end if case else inv_export.of_writeLogMessageError(this, + "row " + & string(al_row) + " field name: " + lower(ls_columnName) + & " (" + ls_data + ") has an unsupported typeDAT*H of " + ls_type + ". Value set to null. " + inv_export.is_errorMessage) setnull(aa_data) end choose end if return aa_data end function public function string of_getrecordstring (long al_row); //returns the data in the given row as a fixed length string //currently only works for datastores with char(n) field types MDY 9/00 integer li_column integer li_pos1, li_pos2 integer li_columnLength, li_dataLength, li_padLength string ls_null string ls_type string ls_datDAT*Ja string ls_temp string ls_record any la_data boolean lb_unsupported setNull(ls_null) setNull(la_data) for li_column = 1 to integer(this.Object.DataWindow.Column.Count) lb_unsupported = false //grab the data for the given column ls_type = this.describe("#" + string(li_column) + ".colType") choose case lower(left(ls_type, 5)) case "char(" /*char(n)*/ ls_data = this.getItemString(al_row, li_column) ls_data = trim(ls_data) //get the column length lDAT*Li_pos1 = pos(ls_type, "(") + 1 li_pos2 = pos(ls_type, ")") ls_temp = mid(ls_type, li_pos1, li_pos2 - li_pos1) li_columnLength = integer(ls_temp) //added by mkc 05/17/01 //strips off the decimal and any right characters that go over the field length if lower(left(this.Describe("#"+string(li_column)+".tag"), 5)) = "decim" then ls_data = left(ls_data,li_columnLength ) if right(ls_data, 1) = '.' then ls_data = left(ls_data, li_columnLength - 1) endDAT*N if end if case "decim" /*decimal(n)*/, "int", "long", "numbe" /*number*/, "real", "ulong" lb_unsupported = true exit la_data = this.getItemNumber(al_row, li_column) case "date" lb_unsupported = true exit la_data = this.getItemDate(al_row, li_column) case "time" lb_unsupported = true exit la_data = this.getItemTime(al_row, li_column) case "datet" /*datetime*/, "times" /*timestamp*/ lb_unsupported = true exit la_data = this.getItemDateDAT*PTime(al_row, li_column) case else signalError(-1, "Invalid column number '" + string(li_column) + "', or unknown column data type '" + ls_type + "'") exit end choose if lb_unsupported then signalError(-1, "Unsupported column data type '" + ls_type + "'. " +& "Function u_ds_base::of_getRecordString() currently supports only datastores where all columns are 'char(n)'") return ls_null end if //make ls_data the right length by padding it with spaces, if necessaDAT*Rry if isNull(ls_data) or len(ls_data) = 0 then ls_data = fill(" ", li_columnLength) else li_dataLength = len(ls_data) li_padLength = li_columnLength - li_dataLength if li_padLength > 0 then ls_data = ls_data + fill(" ", li_padLength) end if end if //add ls_data to the record string ls_record = ls_record + ls_data next return ls_record end function public function boolean of_fileexists (); string ls_pathName //refresh the internal variables for fuDAT*Tll path ls_pathName = this.of_getPathName() if ls_pathName = "?" or ls_pathName = "" then return false end if //check for existing file if fileExists(is_masterFile) then return true else return false end if end function public function string of_getpath ();//******************************************************************************** // // Object: n_ds_conversion_base inherited from datastore // Function: of_getpathname // Access: public // Arguments: nonDAT*Ve // 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 and file nameDAT*X previously set if ss_basePathName = "?" then signalError(-1, "Must call of_setBasePathName() prior to calling of_getPathName()") return ss_basePathName end if return ss_exportPath end function public function integer of_setloadblanklines (boolean ab_loadBlankLines); ib_loadBlankLines = ab_loadBlankLines return 1 end function public function boolean of_basepathnameset (); if ss_basePathName = "?" then return false else return true end if end function public functiDAT*Zon integer of_retrieveappend (string as_arg1[]);//******************************************************************************** // // Object: n_ds_conversion_base inherited from datastore // Function: of_retrieveappend // Access: public // Arguments: string as_arg1[] //allows for a string array argument // Returns: integer // Description: Overload the main of_retrieveAppend() function which takes 8 arguments // //******************************************************DAT*\************************** // Revision History // Date Name Revision //-------------------------------------------------------------------------------- // 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(as_arg1, la_null, la_null, la_null, la_null, la_null, la_DAT*^null, la_null) return ll_rc end function 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);//******************************************************************************** // // Object: n_ds_conversion_base inherited from datastore // Function: of_retrieveappend // Access: public // Arguments: string as_arg1[] //allows for a string array argument // any aa_arg2 // DAT*` any aa_arg3 // any aa_arg4 // any aa_arg5 // any aa_arg6 // any aa_arg7 // any aa_arg8 // Returns: long // Description: // Retrieve data and append to this datastore. Will accept up to 8 retrieval // arguments. // //******************************************************************************** // Revision History // Date Name Revision //-------------------------------------------------------------------------------- // 10/26/2000 Mark YounDAT*bg Initial Version //******************************************************************************** long ll_rc long ll_rows datastore lds_temp if this.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 oDAT*df the current transaction object //and give it to the temp datastore //messageBox("Development", "Fix copy trans functionality to non-pfc") //will need to add 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_temDAT*fp.retrieve(as_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() failed 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 DAT*hif isValid(lds_temp) then destroy lds_temp end if else //we have no rows yet, so retrieve this datastore directly ll_rows = this.retrieve(as_arg1, aa_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 string of_parserecordstring (string as_recordstring); //parses a fixed length string into a tab delimited string, //based oDAT*jn the structure of the datastore //currently only works for datastores with char(n) field types MDY 2/02 integer li_column integer li_pos, li_pos1, li_pos2 integer li_columnLength, li_dataLength string ls_null string ls_type string ls_data string ls_temp string ls_record any la_data boolean lb_unsupported, lb_lengthError setNull(ls_null) setNull(la_data) //loop through the datastore columns lb_lengthError = false li_pos = 1 for li_column = 1 to integer(this.Object.DataWindDAT*low.Column.Count) lb_unsupported = false //grab the column length ls_type = this.describe("#" + string(li_column) + ".colType") choose case lower(left(ls_type, 5)) case "char(" /*char(n)*/ //get the column length li_pos1 = pos(ls_type, "(") + 1 li_pos2 = pos(ls_type, ")") ls_temp = mid(ls_type, li_pos1, li_pos2 - li_pos1) li_columnLength = integer(ls_temp) case "decim" /*decimal(n)*/, "int", "long", "numbe" /*number*/, "real", "ulong" lb_unsuppoDAT*nrted = true exit case "date" lb_unsupported = true exit case "time" lb_unsupported = true exit case "datet" /*datetime*/, "times" /*timestamp*/ lb_unsupported = true exit case else signalError(-1, "Invalid column number '" + string(li_column) + "', or unknown column data type '" + ls_type + "'") exit end choose if lb_unsupported then signalError(-1, "Unsupported column data type '" + ls_type + "'. " +& "Function of_parseRecordStriDAT*png() currently supports only datastores where all columns are 'char(n)'") return ls_null end if //grab the substring from the record string corresponding to the current column ls_data = mid(as_recordString, li_pos, li_columnLength) ls_data = trim(ls_data) li_pos += li_columnLength if li_pos > len(as_recordString) + 1 then lb_lengthError = true exit end if //add ls_data to the record with a tab delimeter ls_record = ls_record + "~t" + ls_data next if lb_lenDAT*rgthError then signalError(-1, "Input string exceeds the row length for datastore '" + this.dataobject + "'") return ls_null end if return ls_record end function public function long of_setupdateblocksize (long al_updateblockSize); long ll_prevUpdateBlockSize ll_prevUpdateBlockSize = il_updateBlockSize il_updateBlockSize = al_updateBlockSize //return previous block size return ll_prevUpdateBlockSize end function public function long of_blockupdate (ref transaction atr_tDAT*transaction);///* //Update all data in datastore in blocks. //Uses il_updateBlockSize to determine how many rows should be updated at a time. // //NOTES: // //This function performs a COMMIT after each block of rows is updated. //(The primary purpose of this function is to reduce the chance of overloading //the rollback segment on large updates, so the commit is necessary.) // //This function can only perform the default type of update() //(i.e. no accept text or reset flags can be specDAT*vified, since this function's //uses the status flags to control the blocked update). // //MDY 5/02 //*/ long ll_rc long ll_row long ll_rowCount, ll_deletedCount, ll_filteredCount long ll_statusFlagCount, ll_statusFlagIndex long ll_statusFlagArrayStartIndex[] long ll_startRow, ll_endRow integer li_buffer dwBuffer le_buffer dwItemStatus le_statusFlag[] //il_updateBlockSize = 0 il_updateModifiedCount = 0 il_updateBlockCount = 0 il_updateBlockNumber= 0 il_updateBlockCommitCountDAT*x = 0 il_updateTotalCommitCount = 0 //if we are not using blocks, just do an update if il_updateBlockSize <= 0 then return this.update() //*** NOTE: no COMMIT is performed in this case *** end if //allocate space for the status flag array all at once ll_statusFlagCount = this.deletedCount() + this.rowCount() + this.filteredCount() //total number of rows, all buffers le_statusFlag[ll_statusFlagCount] = notModified! //this value will be overwritten eventually //grab some of the cDAT*zount values il_updateModifiedCount = this.modifiedCount() + this.deletedCount() ll_rc = ll_statusFlagCount / il_updateBlockSize if mod(ll_statusFlagCount, il_updateBlockSize) = 0 then il_updateBlockCount = ll_rc else il_updateBlockCount = ll_rc + 1 end if //load all the status flags for the datastore ll_statusFlagCount = 0 for li_buffer = 1 to 3 //set variables for next buffer to be processed choose case li_buffer case 1 //delete buffer le_buffer = delete! ll_DAT*|rowCount = this.deletedCount() case 2 //primary buffer le_buffer = primary! ll_rowCount = this.rowCount() case 3 //filter buffer le_buffer = filter! ll_rowCount = this.filteredCount() end choose if ll_rowCount <= 0 then //no rows, don't process this buffer continue end if //grab the start index for each set of buffer update flags //this is the index number in the status flag array where flags for //the current buffer start ll_statusFlagArraySDAT*~tartIndex[li_buffer] = ll_statusFlagCount + 1 //get the status flags for current buffer rows for ll_row = 1 to ll_rowCount ll_statusFlagCount ++ le_statusFlag[ll_statusFlagCount] = this.getItemStatus(ll_row, 0, le_buffer) next next //buffer //update and commit data in the datastore for li_buffer = 1 to 3 //set variables for next buffer to be processed choose case li_buffer case 1 //delete buffer le_buffer = delete! ll_rowCount = this.deleteDAT*dCount() case 2 //primary buffer le_buffer = primary! ll_rowCount = this.rowCount() //reset the update flags for all buffers this.resetUpdate() case 3 //filter buffer le_buffer = filter! ll_rowCount = this.filteredCount() end choose if ll_rowCount <= 0 then //no rows, don't process this buffer continue end if if li_buffer = 1 then //delete buffer //reset update flags for primary and filter buffers //*** can'DAT*t use resetUpdate() here because it will clear the delete buffer *** for ll_row = 1 to this.rowCount() this.setItemStatus(ll_row, 0, primary!, notModified!) next for ll_row = 1 to this.filteredCount() this.setItemStatus(ll_row, 0, filter!, notModified!) next else //primary and filter buffers //reset the update flags for all buffers this.resetUpdate() end if //grab the status flag array index for the start of current buffer //subtract 1, since itDAT* is incremented before each use below ll_statusFlagIndex = ll_statusFlagArrayStartIndex[li_buffer] - 1 //update the current buffer in blocks ll_endRow = 0 do while true il_updateBlockCommitCount = 0 //set the block start row ll_startRow = ll_endRow + 1 if ll_startRow > ll_rowCount then //start row past the end of the buffer; exit loop exit end if //set the block end row ll_endRow += il_updateBlockSize if ll_endRow > ll_rowCount then //endDAT* row past the end of the buffer; set it to last row ll_endRow = ll_rowCount end if //set all the status flags for the block to their original values for ll_row = ll_startRow to ll_endRow //set the status flag array index for the current row ll_statusFlagIndex ++ //set the current row to its original status flag value this.setItemStatus(ll_row, 0, le_buffer, le_statusFlag[ll_statusFlagIndex]) next //update the datastore (only issues delete/iDAT*nsert/update statements //for the current block, since all other rows have been marked notModified) ll_rc = this.update() //do the database commit if ll_rc < 0 then ROLLBACK USING atr_transaction; return -1 else COMMIT USING atr_transaction; if f_sqlCheck(atr_transaction) < 0 then ROLLBACK USING atr_transaction; return -1 end if il_updateBlockCommitCount = atr_transaction.sqlNRows //not working; MDY 5/02 end if il_updateTotalCommitCouDAT*nt += il_updateBlockCommitCount //not working; MDY 5/02 this.trigger event ue_postBlockUpdate() loop next //buffer return 1 end function public function long of_blockupdate ();/* Update all data in datastore in blocks. Uses il_updateBlockSize to determine how many rows should be updated at a time. NOTES: This function assumes the use of SQLCA for the datastore. If another transaction object is required, call the overloaded version as done below with the desired DAT*transaction object as the argument. This function performs a COMMIT after each block of rows is updated (the primary purpose of this function is to reduce the chance of overloading the rollback segment, so the commit is necessary) This function can only perform the default type of update() (i.e. no accept text or reset flags can be specified, since this function's uses the status flags to control the blocked update) MDY 5/02 */ return this.of_blockUpdate(sqlca) end function DAT* public function integer of_resetblocksortkeys (); string ls_empty[] is_blockSortKey = ls_empty return 1 end function public function long of_addblocksortkey (string as_sortkey); //adds a sort key to the block sort keys array //returns the index number for the new key long ll_index ll_index = upperBound(is_blockSortKey) + 1 is_blockSortKey[ll_index] = lower(trim(as_sortKey)) return ll_index end function public function string of_getblocksortstring (); //returns a soDAT*rt string built from the block sort keys array integer li_i integer li_keyCount string ls_sortKey string ls_sortString li_keyCount = upperBound(is_blockSortKey) for li_i = 1 to li_keyCount ls_sortKey = is_blockSortKey[li_i] ls_sortString += ls_sortKey if li_i < li_keyCount then ls_sortString += ", " end if next return ls_sortString end function public function long of_filter (string as_filter);//************************************************************************DAT********* // // Object: n_ds_conversion_base // Function: of_filter // Access: public // Arguments: string as_filter // Returns: long; this.rowCount() // Description: applies a filter to this // //******************************************************************************** // Revision History // Date Name Revision //-------------------------------------------------------------------------------- // 07/25/2000 Mark Young Initial Version //*******************DAT************************************************************** long ll_rc as_filter = trim(as_filter) //check for locked filter if ib_filterLock then signalError(ll_rc, "Data Object: " + is_dataObject + ". The Filter is Locked.") return -1 end if //apply a filter to the master datastore ll_rc = this.setFilter(as_filter) if ll_rc < 0 then signalError(ll_rc, "Data Object: " + is_dataObject + ". SetFilter() failed. Filter string '" + as_filter + "'") return -1 end if DAT* ll_rc = this.filter() if ll_rc < 0 then signalError(ll_rc, "Data Object: " + is_dataObject + ". Filter() failed. Filter string '" + as_filter + "'") return -1 end if return this.rowCount() end function public function long of_sort (string as_sort);//******************************************************************************** // // Object: n_ds_conversion_base // Function: of_sort // Access: public // Arguments: string as_sort // Returns: long; thiDAT*s.rowCount() // Description: Applies a sort to this datastore // //******************************************************************************** // Revision History // Date Name Revision //-------------------------------------------------------------------------------- // 07/28/2000 Mark Young Initial Version //******************************************************************************** long ll_rc as_sort = trim(as_sort) //check for locked sort if ib_sortLock then DAT* signalError(ll_rc, "Data Object: " + is_dataObject + ". The Sort is Locked.") return -1 end if //apply a sort to the master datastore ll_rc = this.setSort(as_sort) if ll_rc < 0 then signalError(ll_rc, "Data Object: " + is_dataObject + ". SetSort() failed. Sort string '" + as_sort + "'") return -1 end if ll_rc = this.sort() if ll_rc < 0 then signalError(ll_rc, "Data Object: " + is_dataObject + ". Sort() failed. Sort string '" + as_sort + "'") return -1 end if retuDAT*rn this.rowCount() end function public function boolean of_setfilterlock (boolean ab_lock); boolean lb_prevLock lb_prevLock = ib_filterLock ib_filterLock = ab_lock return lb_prevLock end function public function boolean of_setsortlock (boolean ab_lock); boolean lb_prevLock lb_prevLock = ib_sortLock ib_sortLock = ab_lock return lb_prevLock end function public function string of_getblocksortkeyname (integer ai_index); //returns the column name of the blDAT*ock sort key with the given index string ls_columnName integer li_len if ai_index < 1 or ai_index > upperBound(is_blockSortKey) then return "?" end if //find the length of the column name part of the sort key (before the A or D protion) li_len = len(is_blockSortKey[ai_index]) - 2 ls_columnName = trim(left(is_blockSortKey[ai_index], li_len)) return ls_columnName end function public function integer of_getblocksortkeynumber (integer ai_index); //returns the column number of thDAT*e block sort key with the given index string ls_columnName, ls_dsColumnName integer li_len integer li_col, li_colCount integer li_columnNumber if ai_index < 1 or ai_index > upperBound(is_blockSortKey) then return -1 end if //find the length of the column name part of the sort key (before the A or D protion) li_len = len(is_blockSortKey[ai_index]) - 2 //get the sort key column name (without A or D portion) ls_columnName = lower(trim(left(is_blockSortKey[ai_index], li_len))) if DAT*ls_columnName = "" or isNull(ls_columnName) then return -1 end if //grab the column count li_colCount = integer(this.object.datawindow.column.count) if li_colCount <= 0 then return -1 end if //loops through the columns in the datastore li_columnNumber = 0 for li_col = 1 to li_colCount //grab the column name from the datastore ls_dsColumnName = lower(trim(this.describe("#"+string(li_col)+".name"))) if ls_dsColumnName = "?" or isNull(ls_dsColumnName) then continue end DAT*if if ls_columnName = ls_dsColumnName then li_columnNumber = li_col exit end if next //column return li_columnNumber end function public function long of_scanblocks (string as_action, any aa_data); boolean ib_keyChange long ll_rc long ll_row long ll_rowCount long ll_startRow, ll_endRow integer li_i integer li_keyColNum[] integer li_colNum string ls_sort //sort rows for block ordering ls_sort = this.of_getBlockSortString() ll_rc = this.of_sort(ls_sort) if ll_rDAT*c < 0 then return -1 end if //get the column numbers for the key column for li_i = 1 to upperBound(is_blockSortKey) li_colNum = this.of_getBlockSortKeyNumber(li_i) if li_colNum <= 0 then //error or column number not found return li_colNum end if li_keyColNum[li_i] = li_colNum next ll_startRow = 0 ll_endRow = 0 ll_rowCount = this.rowCount() //process through the buffer and identify blocks based on sort keys do while true ib_keyChange = false //set the block DAT*start row ll_startRow = ll_endRow + 1 if ll_startRow > ll_rowCount then //start row past the end of the buffer; exit loop exit end if //find the block end row by finding the last row with the same key values as the start row for ll_row = ll_startRow + 1 to ll_rowCount //compare keys for li_i = 1 to upperBound(is_blockSortKey) li_colNum = li_keyColNum[li_i] // //*** debug // any la_any1, la_any2 // la_any1 = this.object.data[ll_row, li_colNum] //DAT* la_any2 = this.object.data[ll_startRow, li_colNum] //if the values for the same column in current and start rows do not match... if ( isNull(this.object.data[ll_row, li_colNum]) and not isNull(this.object.data[ll_startRow, li_colNum]) ) & OR ( not isNull(this.object.data[ll_row, li_colNum]) and isNull(this.object.data[ll_startRow, li_colNum]) ) & OR ( this.object.data[ll_row, li_colNum] <> this.object.data[ll_startRow, li_colNum] ) then DAT* ib_keyChange = true exit end if next //column if ib_keyChange then ll_endRow = ll_row - 1 exit end if next //row if not ib_keyChange then //end row past the end of the buffer; set it to last row ll_endRow = ll_rowCount end if // //*** debugging break point // if ll_startRow <> ll_endRow then // ll_rc = ll_rc // end if //process the block identified by start and end rows ll_rc = this.trigger event ue_scanBlock(ll_startDAT*Row, ll_endRow, as_action, aa_data) if ll_rc < 0 then //stop scan on error return ll_rc end if //if ue_scanBlock() returns null, then stop scan here if isNull(ll_rc) then exit end if loop return 1 end function public function any of_getitemany (long al_row, integer ai_column, dwbuffer adw_buffer, boolean ab_orig_value);////////////////////////////////////////////////////////////////////////////// // // Function: of_GetItemany (FORMAT 2) // // Access: PuDAT*blic // // Arguments: // al_row : The row reference // ai_column : The column number reference // adw_buffer : The dw buffer from which to get the column's data value. // ab_orig_value : When True, returns the original values that were // retrieved from the database. // // Returns: Any // The column value cast to an any datatype // // Description: Returns a column's value cast to an any datatype // /////////////////////////////////////////////////////DAT*///////////////////////// // // Revision History // // Version // 5.0 Initial version // ////////////////////////////////////////////////////////////////////////////// // // Copyright 1996-1997 Sybase, Inc. and its subsidiaries. All rights reserved. // Any distribution of the PowerBuilder Foundation Classes (PFC) // source code by other than Sybase, Inc. and its subsidiaries is prohibited. // ////////////////////////////////////////////////////////////////////////////// string lDAT*s_columnname ls_columnname = Describe ( "#" + String( ai_column ) + ".name" ) Return of_GetItemany ( al_row, ls_columnname, adw_buffer, ab_orig_value ) end function public function any of_getitemany (long al_row, string as_column, dwbuffer adw_buffer, boolean ab_orig_value);////////////////////////////////////////////////////////////////////////////// // Public Function: of_GetItemAny (FORMAT 4) // Arguments: al_row : The row reference // as_column : The columDAT*n name reference // adw_buffer : The dw buffer from which to get the column's data value. // ab_orig_value : When True, returns the original values that were // retrieved from the database. // Returns: Any - The column value cast to an any datatype // Description: Returns a column's value cast to an any datatype ////////////////////////////////////////////////////////////////////////////// // Rev. History Version // 5.0 Initial version // 7DAT*.0 Removed test on computed columns. They can be treated // as normal columns. ////////////////////////////////////////////////////////////////////////////// // Copyright 1996-1999 Sybase, Inc. and its subsidiaries. All rights reserved. Any distribution of the // PowerBuilder Foundation Classes (PFC) source code by other than Sybase, Inc. and its subsidiaries is prohibited. ////////////////////////////////////////////////////////////////////////////// any la_value /* DeterDAT*mine the datatype of the column and then call the appropriate GetItemxxx function and cast the returned value */ CHOOSE CASE Lower ( Left ( Describe ( as_column + ".ColType" ) , 5 ) ) CASE "char(", "char" // CHARACTER DATATYPE la_value = GetItemString ( al_row, as_column, adw_buffer, ab_orig_value ) CASE "date" // DATE DATATYPE la_value = GetItemDate ( al_row, as_column, adw_buffer, ab_orig_value ) CASE "datet" // DATETIME DATATYPE la_value = GetItemDaDAT*teTime ( al_row, as_column, adw_buffer, ab_orig_value ) CASE "decim" // DECIMAL DATATYPE la_value = GetItemDecimal ( al_row, as_column, adw_buffer, ab_orig_value ) CASE "numbe", "long", "ulong", "real", "int" // NUMBER DATATYPE la_value = GetItemNumber ( al_row, as_column, adw_buffer, ab_orig_value ) CASE "time", "times" // TIME DATATYPE la_value = GetItemTime ( al_row, as_column, adw_buffer, ab_orig_value ) CASE ELSE SetNull ( la_value ) DAT* END CHOOSE Return la_value end function public function any of_getitemany (long al_row, string as_column);////////////////////////////////////////////////////////////////////////////// // // Function: of_GetItemany (FORMAT 3) // // Access: Public // // Arguments: // al_row : The row reference // as_column : The column name reference // // Returns: Any // The column value cast to an any datatype // // Description: Returns a column's value cast to an anyDAT* datatype // ////////////////////////////////////////////////////////////////////////////// // // Revision History // // Version // 5.0 Initial version // ////////////////////////////////////////////////////////////////////////////// // // Copyright 1996-1997 Sybase, Inc. and its subsidiaries. All rights reserved. // Any distribution of the PowerBuilder Foundation Classes (PFC) // source code by other than Sybase, Inc. and its subsidiaries is prohibited. // ////////////////////DAT*////////////////////////////////////////////////////////// Return of_GetItemany ( al_row, as_column, Primary!, FALSE ) end function public function any of_getitemany (long al_row, integer ai_column);////////////////////////////////////////////////////////////////////////////// // // Revision History // // Version // 5.0 Initial version // ////////////////////////////////////////////////////////////////////////////// // // Copyright 1996-1997 Sybase, Inc. and its subsidiaries. AlDAT*l rights reserved. // Any distribution of the PowerBuilder Foundation Classes (PFC) // source code by other than Sybase, Inc. and its subsidiaries is prohibited. // ////////////////////////////////////////////////////////////////////////////// string ls_columnname ls_columnname = Describe ( "#" + String( ai_column ) + ".name" ) Return of_GetItemany ( al_row, ls_columnname, Primary!, FALSE ) end function public function any of_buildexpression (long al_row, string as_column, string aDAT*s_operator, string as_optionalvalue);////////////////////////////////////////////////////////////////////////////// // // Function: of_BuildExpression // // Access: Public // // Arguments: // al_row : The row reference // as_column : The column name reference // as_operator : The desired operator. // "=" Equals // ">" Greater than // "<" Less than // "<>" Not equal // ">=" Greater than or equal // "<=" Less than or eDAT*qual // as_optionalvalue: An optional value. If found it will not used the // row/column value. // // Returns: Any // The column value cast to an any datatype // // Description: // Returns a complete expression string that can be used on any Find or // Filter operation. // For example, 'hired_date > Date("1/1/95")' will be the result for // as_column='hired_date', as_operator='>', as_optionalvalue='1/1/95'. // //////////////////////////////////////////////////////DAT*//////////////////////// // // Revision History // // Version // 6.0 Initial version // 7.0 Added "char" datatype to case statement // ////////////////////////////////////////////////////////////////////////////// // // Copyright 1996-1997 Sybase, Inc. and its subsidiaries. All rights reserved. // Any distribution of the PowerBuilder Foundation Classes (PFC) // source code by other than Sybase, Inc. and its subsidiaries is prohibited. // /////////////////////////////////////////DAT*///////////////////////////////////// string ls_expression string ls_coltype string ls_value // Verify passed arguments. If as_optionalvalue = '#@notapplicable@#' Then // Only test row number when there is no optional value. If IsNull(al_row) or al_row <= 0 or al_row > RowCount() Then Return '!' End If If Len(Trim(as_column))=0 or IsNull(as_column) Then Return '!' If as_operator='=' or as_operator='>' or as_operator='<' or as_operator='<>' or & as_operator='>=' or as_operator='<=DAT*' Then // Good value. Else Return '!' End If // Get the column type. ls_coltype = Describe(as_column+'.ColType') If ls_coltype='!' or ls_coltype='?' Then Return '!' // Either get the current value or use the passed in value. If as_optionalvalue = '#@notapplicable@#' Then ls_value = string( of_GetItemAny(al_row, as_column) ) Else ls_value = as_optionalvalue End If If IsNull(ls_value) Then //-- Build NULL value expressions. -- If as_operator='=' Then ls_expression = 'IDAT*sNull('+as_column+')' ElseIf as_operator='<>' Then ls_expression = 'Not IsNull('+as_column+')' Else ls_expression = '!' End If Else //-- Build NonNull value expressions. -- // Start building the Find/Filter expression. ls_expression = as_column + ' ' + as_operator + ' ' // Wrap the value with datatype conversion functions, so that // the value is valid in Filter and Find expressions. // Note: a number value does not need any special handling. Choose Case Lower ( LeDAT*ft (ls_coltype, 5 ) ) // CHARACTER DATATYPE Case "char(", "char" ls_expression += "'" + ls_value + "'" // DATE DATATYPE Case "date" ls_expression += "Date('" + ls_value + "')" // DATETIME DATATYPE Case "datet" ls_expression += "DateTime('" + ls_value + "')" // TIME DATATYPE Case "time", "times" ls_expression += "Time('" + ls_value + "')" // Number Case Else ls_expression += ls_value End Choose End If ReturnDAT* ls_expression end function public function any of_buildexpression (long al_row, string as_column, string as_operator);////////////////////////////////////////////////////////////////////////////// // // Function: of_BuildExpression // // Access: Public // // Arguments: // al_row : The row reference // as_column : The column name reference // as_operator : The desired operator. // "=" Equals // ">" Greater than // "<" Less than // DAT* "<>" Not equal // ">=" Greater than or equal // "<=" Less than or equal // // Returns: Any // The column value cast to an any datatype // // Description: // Returns a complete expression string that can be used on any Find or // Filter operation. // For example, 'hired_date > Date("1/1/95")' will be the result for // as_column='hired_date', as_operator='>', as_optionalvalue='1/1/95'. // //////////////////////////////////////////////////////////////////////////DAT*//// // // Revision History // // Version // 6.0 Initial version // ////////////////////////////////////////////////////////////////////////////// // // Copyright 1996-1997 Sybase, Inc. and its subsidiaries. All rights reserved. // Any distribution of the PowerBuilder Foundation Classes (PFC) // source code by other than Sybase, Inc. and its subsidiaries is prohibited. // ////////////////////////////////////////////////////////////////////////////// string ls_nooptionalvalue =DAT* "#@notapplicable@#" Return of_BuildExpression (al_row, as_column, as_operator, ls_nooptionalvalue) end function public function any of_buildexpression (long al_row, string as_column);////////////////////////////////////////////////////////////////////////////// // // Function: of_BuildExpression // // Access: Public // // Arguments: // al_row : The row reference // as_column : The column name reference // // Returns: Any // The column value cast to an any datDAT*atype // // Description: // Returns a complete expression string that can be used on any Find or // Filter operation. // For example, 'hired_date > Date("1/1/95")' will be the result for // as_column='hired_date', as_operator='>', as_optionalvalue='1/1/95'. // ////////////////////////////////////////////////////////////////////////////// // // Revision History // // Version // 6.0 Initial version // //////////////////////////////////////////////////////////////////////////////DAT* // // Copyright 1996-1997 Sybase, Inc. and its subsidiaries. All rights reserved. // Any distribution of the PowerBuilder Foundation Classes (PFC) // source code by other than Sybase, Inc. and its subsidiaries is prohibited. // ////////////////////////////////////////////////////////////////////////////// string ls_defaultoperator = "=" string ls_nooptionalvalue = "#@notapplicable@#" Return of_BuildExpression (al_row, as_column, ls_defaultoperator, ls_nooptionalvalue) end functioDAT*n public function string of_getcolumntype (integer ai_column); ////******************************************************************************** //// //// Object: n_ds_conversion_base inherited from datastore //// Subroutine: of_checkformat //// Access: public //// Arguments: integer ai_column //// Returns: string - first five lower case of the column type for a given colunn //// Description: //// ////***************************************************************DAT****************** //// Revision History //// Date Name Revision ////-------------------------------------------------------------------------------- //// 02/10/2004 Michael Colombo Initial Version ////******************************************************************************** string ls_type //get column type ls_type = this.Describe("#"+string(ai_column)+".coltype") //get left 5 and lower case ls_type = lower(left(ls_type, 5)) return ls_type end function public functionDAT* long of_populatecolumntypes ();//populates the column type in an instance array //return the long ll_column, ll_colCount string ls_columnTypeClear[] //clear column type array is_columntypes = ls_columnTypeClear //get column count ll_colCount = long(object.datawindow.column.count) //loop through each column and assign the column type to the corresponding index //in the array for ll_column = 1 to ll_colCount //populate the column type is_columntypes[ll_column] = this.of_getcoDAT*lumntype(ll_column) next return ll_colCount end function public function any of_trimdata (long al_row, integer ai_column);//This function trims the data so that no empty spaces appear at the end or the //beginning used in the datamart //must call the of_populatecolumntypes first //note there is little error checking string ls_type, ls_data any la_data if upperbound(is_columntypes) < ai_column or ai_column < 1 then ls_type = "" end if ls_type = is_columntypes[ai_column] DAT* choose case ls_type case "char(", "char" ls_data = object.data[al_row, ai_column] la_data = trim(ls_data) case else la_data = object.data[al_row, ai_column] end choose return la_data end function on n_ds_conversion_base.create call super::create TriggerEvent( this, "constructor" ) end on on n_ds_conversion_base.destroy TriggerEvent( this, "destructor" ) call super::destroy end on event dberror; //don't display db error message il_error = sqlDBCode is_errorDAT*  = sqlErrText return 1 end event event constructor; //increment the internal class instance count si_count ++ //copy the shared export object reference to instance variable inv_export = snv_export end event event destructor; //decrement the internal instance count si_count -- //if there are other instances of this class, don't delete the temp file if si_count > 0 then return 0 else //delete the temp file fileDelete(ss_exportPath + ss_tempFileName) end if returDAT* #*4  integer#.tagdescribe`.coltype`string``Argument 'aa_column' was not an integer or stringdecimal() 4 D L $6d  is_description  8J18 0+@+86\$8dDAT*<t|$z%8z&$z&8z%$z&$6<Jfd 8 ?Must call of_setBasePathName() prior to calling of_getPathName()is_basefilenameKis_masterfileeK.is_ext1ee\ t |     ,o@988DAT*emtkm@ectiwer@  A(      1Ud! al_rowas_actionaa_data<  > $6)(881)H8P$1`8h0lDAT*$8t$z%8z&z&8z&+@+896$1.9890^v"$% &*'.d% as_findll_rowls_dataobject<  P dataobjectrowcountil_row0findc@0is_findX0Data Object: is_dataobjectcto. Find() fDAT*ailed. Find string ''rX0 ( 8 H P ` l     $1 $8(",$84T$z%8\z&+@+89$)89$$1R)8)8$1|$84$z%8 z&4$z&8<z&+@+89DAT*$@$1992v !"r%|&'(d H il_rowis_findData Object: is_dataobject)C. A successful call to of_find() must be made before calling of_findNext()rowcountg 'findamecC. FindNext() failed. Find string ''  , T DAT* H ib_handlearraycurrent5ib_selectionsprocessed(6 @ L1) 8<1<"<d ll_rc( of_getallselecteditemsh )8<1Fg(oV0*V*)@8<DAT*11 (Fbzd7 al_handleaa_datall_rclstruct_dataltvi_itemd  - H( getitemLdata setitemY8  ( 0 @ f-goV- *V1  4PdDAT*' atvi_itemaa_datalstruct_data<  ( data   $:F@@8)8}1<\$} $//}/}4$}9)H8)d8}9)l81<`8t08DAT*0@8~9)8)8}9)81<8t080@8)8 >\r !."V'`(~)*+,/1dM al_handleltvi_itemli_rcli_itemstateli_olditemstatelb_prevredrawx "DAT*/?X getitemL  ib_redraw(4setredraw!<of_setparentstateeP!<TreeView ErrorAn error occurred in of_setParentState()!<of_setitemstated!<An error occurred in of_setItemState()ue_selectionchanged_   4 H d l     )8}1<BDAT*})08}1</L`$|111*V*)8}1<r:V@)81)8}1<:V@)8 $BX|DAT*S'ICn_ds_conversion_base.'>ICn_ds_conversion_base.S'>'>'GQSWWBrmSSIHICn_ds_cache_base.'>>>L Ldt 8d x _initsrcnonvisualobjectn_cst_conversion_bDAT*asestructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobject_sharsrcn_ds_cache_basew_exportstr_record_countn_ds_conversion_baseh@!7@A@O@[@o@{@@ @ @ @ = tItta(aDAT* ls@t_da _r@0 thli@ /he@  .(     .(d 0 iw_exportids_logfile ( ) 88(z&z&8,zDAT* &(@(8z(8/z&)T8< nd0 ads_exportal_rowcountas_messagell_rcP  *\ of_getfiledescription: ; records found.of_writelogmessage? T 4)81 d aw_export   of_synchronizDAT* e "}1 d ab_run ()81d  ue_synchronize R $9)(8<$1)P81X$9)`818h0+@+81$$80)DAT*98$)8$9)81"JZ| "$<d as_messagell_row( h dw_log_filePnsetredraw!ids_logfile0insertrowDPn!Failed inserting row into log file.0objecte@line__set_attribute_itemd.Pnscrolltorow?Pn! ( < PDAT* X `        $,1)<88Dz&)T8(@(8z(8\z&p$(@(8z(8xz&)8<,d ads_exportll_rc( 0 il_rowerrorof_getfiledescription)$: rowcountH recoDAT* rds written.  records in error.of_writelogmessage  < T p  r8)<8z'8Dz&z&)\8<^d$ ads_exportas_messagell_rc<  d il_rowerror*Error: of_getfiledescription&: of_writelogmessageH < \ TDAT*2  2 xywidthheighttaborderborderstylehscrollbarvscrollbarhideselectiondisplayonlytextcolortextsizeweightfacenamefontcharsetfontfamilyfontpitchT%   ".9DR^h@qxDAT*t] o%    E @@ @1DAT*2 B widthheighttaborderlivescrollis_sqlib_retrieveappendx)0] o @  @ @ DAT*z;0 xOD8OH   4(48DAT* 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. // //******************************************************************************** // Revision History // Date Name Revision //----------------------------------------------------------------------DAT*---------- // 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 //(of_scan() will return the row stopped on) //Return Negative Value to stop the scanning process with error status //(of_scan() wilDAT* cturemailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectstatictextst_1fontcharsetfontpitchfontfamilyalignmentfillpatternborderstyledatawindowdw_1dwobjectD@j@k@R&@m@+@@6@@B@^@QOa@p@``@@j@tx in@item i_@sele @DAT*"of_g ri@n() as@sage @ing(t)@reco")@retu @funcndctio@@@@ W$ @0--@--!<@GL /@ wW ,*. y%DAT*$2  2 S xywidthheighttitlebartitlebackcolorcontrolmenuwindowtypest_1dw_1  " @(2>I N ] o   DAT*&x1  @@@  2  2 ~ xywidthheightenabledfocusrectangletextcolorbackcolortextsizeweightfacenamefontcharsetfontfamilyfontpitch  !0DAT*(:D MT ]it] o    @2  2 O xywidthheighttaborderborderstylehscrollbarvscroDAT*llbarlivescroll  ".9D] o @  @  DAT*,z-@8 @81}X$89n48g8<9nD8g8L9nT8e@e8f 9}8\(@(8z'8^z&)p981o@o88xH )8  8@81R}8@8}DAT*. <<<Y@8 6e@e8}:88"8"8"8"8" 9}f J8V:86 9}f )8V :8 9}f )8V :88" 9}f )$8V:1DAT*08,(@(8z'8Dz&z&8ez&+@+8f 18gz%8z&8z&+@+86  1" 8<B@B8N }<<Y}1<N  8<B@B8z'   z%N 68&Nb!"#$"&D'()*+, -.2/JDAT*20V1Z2|3456786;:<B>BCDEFG HMNObQfd al_rowli_columnli_pos1li_pos2li_columnlengthli_datalengthli_padlengthls_nullls_typels_datals_templs_recordla_datalb_unsupportedcase26, accoab!s)nd9hoGblT \ ed orl art DAT*4gl~Bain P objectd@datawindow__get_attributee#columns#counten##.colTypedescribe`gchar(getitemstring~()decimintlongnumberealulonggetitemnumberdategetitemdate|timegetitemtimedatettimesgetitemdatetimeInvalid column number '', or unknown column data type ''Unsupported column data type ''. Function u_ds_base::of_getRecordString()DAT*6 currently supports only datastores where all columns are 'char(n)'  4 D T p     $ 4880)(8d 0 createconstructortriggerevent ( 4880)(8d 0 destroydestructortriggerevent ( x8(@(8z'8DAT*8z&z&806:)@@81 : fd= sqldbcodesqlerrtextsqlsyntaxbufferrowls_messagex  '.2 - Database Error: Database ErrorJ,)8,01>, $d sqlca::message(@DAT*:@( settransobject  L2 B of_getrecordstring+create+destroy+dberror+constructord##,5^@2  M  "*x]XDAT*PfhLDAT*>8o(@(8z'8z&)$98 8,o(@(88z&)498 18<0+@+811o@o88b8h@81R}8j@8}<<Y}<<@8e@e81&1DAT*@"6|# %<&l'(*+,./d< aa_columnls_typeli_startli_endli_lengthcase23x #*4 l integer#.coltypedescribe`stringa`Argument was not an integer or stringchar(()$ 4 ?:F@@8)088$63@38#1DAT*B8@H$z%8Pz&+@+81p$:I@18x0+@+81$:@P180+@+811<v)8j#180+@+814H$6/)\81<19t$=@=8DAT*D<1~1$1)81$/@/8$/@/818$z%8z&(@(8z(+@+81)81P $/@/8$/@/88(@(8z'+@+81DAT*F1"<$/@/8D$/@/88L(@(8z'+@+811)t8:@)|81R:@)8<1$/@/8$/@/818(@(8z'+@+81*$$:IDAT*H@!/)81<1/)81<11 :!b"&'(,-.@2P3d7v89:<?@DF&I0JfKvLzNOQRSTUVpZ[\^_`a>bLdnefghloqtrstu xy$}*Ptd: ai_sequencell_rcll_rowls_datalds_tempcase91xDAT*J! ) 2 is_masterfileof_getpathname File  does not exist.ie_saveastypea Cannot load data from a non-text file typeie_fileaccessonv Cannot load data when file access mode = write!.resetdatastoreFailed creating datastore lds_tempdataobjecto<of_fileopenPil_masterhandled ib_loadblanklines|insDAT*Lertrowd il_temphandle File read failed for rs; line importstringd  Data row out of range; line d  Invalid data from file; line rowcountjjrowscopy1d  Rows copy failed; line ib_keepfileopena Pof_fileclose 0 8 H p   4 H \ t        DAT*N  < D t |        $#l18$0+@+811  4\ld anv_export C inv_exportFailed initializing inv_export  >)8$11(dDAT*P , resetil_rowerror $ h @8oooooooo)8 Td aa_arg1ll_rcla_null<$ of_retrieveappend  )81V j( #j1800+@+81 L`$6DAT*R ,)x8<1 8 $6(@(8z'+@+81  oooooooo)8  1  80+@+81 1B 1 :@)81R:@)8<1B 80+@+81 R  oooooooo)0DAT*T8  1 880+@+81 $%*&6'^)j0123489T:d;j<@ABC DE6IBJLMRPVQRSXde aa_arg1aa_arg2aa_arg3aa_arg4aa_arg5aa_arg6aa_arg7aa_arg8ll_rcll_rowslds_tempsqlca (08@DAT*VHNV _@JP rowcountdatastoreFailed creating ids_tempdataobjectTsettransobjecthSetTransObject() failed for lds_temp. DataObject = retrieve@Retrieve() failed for lds_temprowscopy@RowsCopy() failed for lds_tempRetrieve() failed (L ` x     0 f::F@DAT*X@8)08D8Lz%)d81<l$63@38#"t/)81<1$6$$)8<1p18$z%+@+81z$:I@180+@+81/)$81<1DAT*Z,$64$9)<8<1T$/@/818\$z%+@+81/)p81<1/)x81<19F$=@=8<1tFL1BL1L$/@/8$/@/818DAT*\$z%8z&(@(8z(+@+81$6A@A8<1B$/@/8$/@/818$z%8z&(@(8z(+@+81/)81<z14$<$:I@!/)D81<1 /)LDAT*^81< 1`$@h$)8P11 :#X&j*+./0,1`4p8t9:>?CD4EDFhGKLPQUWZ&[\\l]p^_`abc<gLhijkl2oBrFsjyz{| <@Pd) ai_sequencell_rcll_rowls_dataP!  DAT*` is_masterfileof_getpathname is_tempfile8$conv.tmpue_cleanupVof_filecloseetTtie_saveastypemp ib_headingssaveasFile save failed for  Cannot append data to a non-text file typet8 il_masterhandleD 8of_fileopenddil_temphandle D  File read failed for 8; line D D  File write faDAT*biled for ; temp file line 4tib_keepfileopen$ dtinv_exportTTof_addtototals"p 0 D d l        $ , 4 < T \ p x          4 < D L ` h  1@88DAT*dV8z%z'1@V!rd6 as_exportpathas_basefilenamels_basepathname<  &  \4 $1\18 D$z%+@+81Tl$6,)8<18z%+DAT*f@+811L\x $%&'*d) as_extas_dataobjectll_rcsqlcaP  #@8 il_masterhandle File already open is_masterfile3is_extLis_dataobject\dataobjectt\settransobjectSetTransObject() failed. DataObject =  D T l   DAT*h *1d ae_fileaccess  ie_fileaccess\  .61d as_description   is_description  *}1d ab_headings ib_headings DAT*j$1\18 D$z%+@+81\d)|81L\x d as_name ( il_masterhandle File already open is_masterfile3is_basefilenameL3of_getpathnamel D \ d | *1d DAT*lae_saveastype  ie_saveastypee  *}1d ab_keepfileopen  ib_keepfileopen 2 o@9888o(@(8z'8z&)(98 80o(@(88z&)898 18@0+@+8DAT*n16e@e8"6| d# aa_columnls_limitcase20<  r integer#.edit.limitdescribe`string`Argument 'aa_column' was not an integer or string( 8 @8o@9888o(@(8z'8z&)(98DAT*p&80o(@(88z&)898&18@0+@+8668r\8x6>R &!6"J#X$p%~&d2 aa_columnas_datals_casecase22case32d  " * ~ inDAT*rteger#.edit.casedescribe`string`Argument 'aa_column' was not an integer or stringupperlower( 8  1)81b($800)\811l$8t9n8g89n8g89n8e@e8}1<1} <n8VnDAT*t o)8<1 $88(@(8z'8z&) 98z')(8.Vb r"$%.&`'j)n*+- 2dH aa_datall_rcll_rowli_colcountli_colaa_dataitemx-")5<0` insertrowinv_exDAT*vportInsertRow() failed.of_writelogmessageerrorDobjectd@datawindow__get_attributecolumncountof_checkformatsetitemFailed writing data value to column: #.namedescribe`D ( \ l         ( *I@88(@(8z'8 z&)988(@(8DAT*xz'8$z&),988485"")H8o(@(884@@8\$t$|$840# 1o@o88 )8}<$8(@(8z'8z&z(8z&z&8z&(@(DAT*z8z(8z&$$z&)48<o@o86)L8V8T *o@988Z)|8})8}1<6%@%8i@8Vo(@(8 8@81Y}<|  1<!1<!1DAT*|<!6%@%8i <<Y@8V|  1<R<" 1<1<!1<!!6%@%8i1@8i(@(8<o@o98%@%8V|$8(@(8z'8z&z(8z&z&8z&(@(8z(8z&$$z&)DAT*~81V&$8(@(8z'8z&z(8z&z&8z&$$,$z&)48@88< 8@ "8E "8K "< )T8}<1<!\$8(@(8z'8z&z(8z&z&8dz&(@(8z(8{z&$DAT*$z&)8@88 $8(@(8z'8z&z(8z&z&8z&$$z&)8@88 ( o@988$ $8(@(8z'8z&z(8z&z&8z&8$@$z&)H8@88P > " DAT*6@88U0)@)8V: `$8(@(8z'8z&z(8z&z&8hz&$$z&)8@88 L  6.@.880)@)8VH $8(@(8z'8z&z(8z&z&8z&$$z&)8@8DAT*8 8 "b  6@8@8V^ $8(@(8z'8z&z(8z&z&8z&<$D$z&)L8@8T$8(@(8z'8z&z(8z&z&8\z&z&8zz&$$z&)8@8obDAT* $#@$\(*+,-.0 5789:J;f<=?AC"D8E|FG0HIMlP|QT V&WtXYZ^r`ad f8 gP h~ k m$ n< pP q r u w: xR z^ { | , H r ~ B ^ b d ai_columnal_rowaa_datals_typels_columnnamels_datali_decimalplaceli_fieldlengthli_fieldlimitli_positioncase42! DAT*) 7 ?O^lx  #.namedescribe`.tag`?of_getcolumntype.7inv_exportPis_errormessagedPdchar(of_getstringfieldlengthProw field name: (). Length was greater than . Value was trimmed. (Pdof_writelogmessagewarning*of_checkcase<decimdecimalof_gDAT*etdecimalfieldplacebof_getfieldlimit.P. Value set to 0. Pdof_writelogmessageerrorP) was not a decimal. Value set to null. PdintlongnumbeulongP) was not <= to limit . Value set to null. PdP) was not a number. Value set to null. id"Pdreal) P) was not a real number. Value set to null. PddateyyyymmdDAT*dP) was not a date. Value set to null. PdtimehhmmoP) was not a time. Value set to null. PddatettimesP) was not a datetime. Value set to null. PdP) has an unsupported type of . Value set to null. <Pd , H \ t |      4 L |       $ DAT*, 4 T \         8 @ H `         < D L T    h1@8 @81}X$89n48g8<9nD8g8L9nT8e@e8T 9}8\(@DAT*(8z'8^z&)p981o@o88x6 )8  8@81R}8@8} <<<Y@8 6e@e8}8\(@(8z'8z&)981o@o9882  <o@o8 1@DAT*882  1<Yo@o8(88"8"8"8"8" 9}T J8V(8$ 9}T )8V (8n 9}T )8V (88" 9}T )48V(18<(DAT*@(8z'8Tz&z&8uz&+@+8T ~18wz%8z&8z&+@+86  1" 8<B@B8< }<<Y}1<<  8<B@B8z'   z%N 68&Nb!"#$"(D)*+.2/0123456 788DDAT*9H:j;<=>?@$C(D0FpJ~KLMNOP U<WPYTd al_rowli_columnli_pos1li_pos2li_columnlengthli_datalengthli_padlengthls_nullls_typels_datals_templs_recordla_datalb_unsupportedcase26,!)9GT \ d l t DAT*~  X object@datawindow__get_attribute#column#count##.colTypedescribe`gchar(getitemstring~().tagtre`gdecim.intlongnumberealulonggetitemnumberdategetitemdate|timegetitemtimezdatettimesgetitemdatetime$Invalid column number '', or unknown column data type ''Unsupported column data type ''. Function u_ds_base::of_getReDAT*cordString() currently supports only datastores where all columns are 'char(n)'  4 D T p      4 )88 8""H94$63@38|99> H nx|d ls_pathname < of_getpathname?is_masterfile# 4 ^8DAT*J18 0+@+866<Jd K ?Must call of_setBasePathName() prior to calling of_getPathName()*}1d ab_loadblanklines$ ib_loadblanklines 28"9,9"d ?l DAT*@8ooooooo)8 Xd* as_arg1 ll_rcla_null<-"$ of_retrieveappend  )81Z j( #j1800+@+81 L`$6 ,)x8<1 8DAT* $6(@(8z'+@+81  ooooooo)8  1  80+@+81 1F 1 :@)81R:@)8<1F 80+@+81 V  ooooooo)08  1 880+@+DAT*81 $%*&6'^)j0123489X:h;n<@ABCDE:IFJPMVPZQRSXdq as_arg1 aa_arg2aa_arg3aa_arg4aa_arg5aa_arg6aa_arg7aa_arg8ll_rcll_rowslds_tempsqlca-$,4<DLTZDAT*b k@JP rowcountdatastoreFailed creating ids_tempdataobjectTsettransobjecthSetTransObject() failed for lds_temp. DataObject = e mretrieve@aRetrieve() failed for lds_temprowscopy@RowsCopy() failed for lds_tempRetrieve() failed (L ` x     0 +@8 @DAT*89}1}1}v$89n48g8<9nD8g8L9nT8e@e8 9}8\(@(8z'8^z&)p981o@o88x68~@81R}8@8} <<<Y@8 6e@DAT*e8}88"8"8"8"8" 9}8 9}8 9}88"B 9}18(@(8z'8z&z&8z&+@+8 18z%8z&8z&+@+86 <<@DAT*8  1R<p9}  8zz% z&l18|$z%8z&+@+86 68DVDl"#$%'2()*+,-./01.2:3>4B589;?@$B4CBD`ElIpKMNORd as_recordstringli_columnli_posli_pos1li_pos2li_columnlengthli_datalengthls_nuDAT*llls_typels_datals_templs_recordla_datalb_unsupportedlb_lengtherrorcase30@ ")19IW _ g o w  0 object@datawindow__get_attribute#column#count#DAT*#.colTypedescribe`gchar(()decimintlongnumberealulongdatetimedatettimesInvalid column number '', or unknown column data type ''Unsupported column data type ''. Function of_parseRecordString() currently supports only datastores where all columns are 'char(n)' Input string exceeds the row length for datastore 'dataobject 4 D T p  8$$(d2 DAT* al_updateblocksizell_prevupdateblocksize(, il_updateblocksize $ @W 1<1\111$1)8<)8)8R)8R  :@)48)<8RD$IIkLDAT*$1T\1R1 1} 1 <B }1<( :@)d81<f :@)l81< :@)t81> < 1R1>  1 )8 1DAT*}b 1 <. }1< :@)8J1< :@)8)8J1<J :@)81^* 1<B1)81:@:@)81)8>1:@:@)8DAT*T)8 <=1Y 19*1  1R * $    \1  =)8)8<1-1--<81-1- $(0$)L8X1DAT* ,!B"X&n',-01$2J3h4|5:;>?AB C$E<FJGbIzJMOUXZ[]:_>cBfvgijlnort v$w2{J}Z^r:>BTt(X\x&*.d atr_transactionll_rcll_rowll_rowcountll_deletedcountll_filteredcountll_statusflagcountll_statusflagindexll_statusDAT*flagarraystartindexerll_startrowll_endrowli_bufferle_bufferle_statusflagcase62case102@ %1ARex--T8 il_updatemodifiedcountDAT*il_updateblockcount(il_updateblocknumberDil_updateblockcommitcountdil_updatetotalcommitcountil_updateblocksizefupdatedeletedcount^rowcountfilteredcountbmodifiedcount$^((^bgetitemstatus|^resetupdatebsetitemstatusbddDAT* due_postblockupdate8 < \         4 < D L T \ d l t                  ( 0 L $)8d sqlca@  of_blockupdateDAT* .|1d  ls_empty -  is_blocksortkey T$1R $  Dd as_sortkeyll_index( ( is_blocksortkey  $}1}<DAT* $<=6z%8(z%26  J nd2 li_ili_keycountls_sortkeyls_sortstringP  $ + is_blocksortkey,    $h8 @$z%8Hz&+@+81DAT*)l8<18 t$z%8|z&z&8z&+@+81)8<1x8 $z%8z&z&8z&+@+81)8 \h #$%&l)xd as_filterll_rc( 8 ib_filterlockData Object: is_dataobject/DAT*. The Filter is Locked.setfiltera/. SetFilter() failed. Filter string ''filtera/. Filter() failed. Filter string 'rowcount @ l t     $h8<$z%8Dz&+@+81)d8<18l$z%8tz&z&8z&+@+81)8DAT*<1x8$z%8z&z&8z&+@+81)8 \h #$%&l)xd as_sortll_rc( 8 ib_sortlockData Object: is_dataobject+. The Sort is Locked.setsort[+. SetSort() failed. Sort string ''sort+. Sort() failed. Sort string 'rowcountDAT* < d l    8$} } (d ab_locklb_prevlock(( ib_filterlock  8$}} (d ab_locklb_prevlock($ ib_sortlock  DAT*1<$<"@8 0$$<=1Y},$<=<o@o860 @ pd& ai_indexls_columnnameli_len< 4 is_blocksortkey? $ , `1<$<"@1 $DAT*<=1Y}($<=<o@o880"18$8@9n\8g8d9nl8g8t9n|8e@e8}1<|11}1}P8(@(8z'8z&)988"*LLDAT*}P 0@pXl|!" #&&*'<(H+L-PdY ai_indexls_columnnamels_dscolumnnameli_lenli_colli_colcountli_columnnumber  /6=I@ is_blocksortkeyobject1@datawindow__get_attributeKcolumnKcountK#.namedescDAT*ribe`?  ( 8 \ l |  2& ) 8 6)081T11}tH$< )l8} 1< < <  }j11)89 9}1RZ 1R|1}DAT*$<  <=}$80 <9n98$80 <9n98#!$80 <9n98#$80 <9n98!"$80 <9n98$80 <9n 98{"9}DAT*1Yr#6o)$81  1 8HT" $('4(H*V.Z13;?z@DEFGJLNWY[_`ce d as_actionaa_dataib_keychangell_rcll_rowll_rowcountll_startrowll_endrowli_ili_keycolnumli_colnumls_sorth DAT*'-4@LVh[-t~ , of_getblocksortstringof_sort!(is_blocksortkey8of_getblocksortkeynumber%Prowcountt8object@data__get_attribute_item@@@@@ue_scanblockDAT* 0 H l                $ v8(@(8z'8 z&)986n48#%Fd@ al_rowai_columnadw_bufferab_orig_valuels_columnnamed$2 < #.nameDeDAT*scriberin`of_getitemany($ 4 n8z%)981o@o988$8*")@8V^8H)\8V ^8d")|8V^8dK8V^88"8"8"8DAT*"J8V^88"B)8V ^@8oJp "#6%`&()+>,B0^dC al_rowas_columnadw_bufferab_orig_valuela_valuecase23x $2; 8 .ColTypeDescribe`char(cDAT*hargetitemstring/dategetitemdateMdatetgetitemdatetimejdecimgetitemdecimalnumbelongulongrealintgetitemnumbertimetimesgetitemtime @ \ |    26:@9n8d al_rowas_column(   of_getitemany)( x8(@(8z'8 z&)DAT*986:@9n48Fd' al_rowai_columnls_columnname< < #.nameDescribe`of_getitemany($ 4 !8T1")$8"T8,01"8,08.80"82"84"87"DAT*8:"8,08=z%)P988,8X"f8,086nh8(@(86T8.8pz%8xz&P84>8zz%8xz&P8,08z%z&8z&1o@o888"8DAT*z%8z&z'868z%8z&z'8v8z%8z&z'88"8z%8z&z'z%6246T7:;?@0CfDzEFIKLMNO:P>RPVT[|^_bc f2gJjrknotd` al_rowas_columnas_operatoras_optionalvaluels_expressionlDAT*s_coltypels_valuecase91  % 6 D O X  #@notapplicable@#rowcount!=><<>>=<=.ColTypeDescribe`F?of_getitemany)ZIsNull()Not IsNull( char(char'dateDate('')datetDateTime('timetimesTime('$ P h 8666n08,d8 DAT* al_rowas_columnas_operatorls_nooptionalvalueP  %8 #@notapplicable@#of_buildexpression=+0 8666n08&d? al_rowas_columnls_defaultoperatorls_nooptionalvalueP , 8 =#@notapplicable@#of_buildexpression+0 DAT*8(@(8z'8 z&)981o@o86Fnd ai_columnls_type( $ #.coltypedescribe` |($809nL8g8T9n\8g8d9nl8~@~81t$ DAT*)8 d@ ll_columnll_colcountls_columntypeclear) 4<4-8 is_columntypesobject @datawindow__get_attribute;column;count;of_getcolumntypele.| ( L \ l t  X $<1<"B8 0DAT*Structure to Maintain File Record and Error Countsglobal type str_record_count from structure string description long row_count long error_count end type DAT*$$<=668,82"@$8H0<9nd98^VHl$8H0<9nt98Vo 0BfvHd9 al_rowai_columnls_typels_datala_datacase15x ! )DAT*1 |0 is_columntypesbjechar(charobjectet7@data__get_attribute_itemM7@M $ @ d l t 4880)(8d 0 createconstructortriggerevent ( 480) 8(8d 0 destructortriggerevent destroy >DAT*(61,d2 sqldbcodesqlerrtextsqlsyntaxbufferrowd  '.0 il_erroris_error ( R,81F,$ d ::message@$ inv_exportDAT*Base class for Datastore. Handles DBError event.forward global type u_ds_base from datastore end type end forward global type u_ds_base from datastore end type global u_ds_base u_ds_base forward prototypes public function string of_getrecordstring (long al_row) end prototypes public function string of_getrecordstring (long al_row); //returns the data in the given row as a fixed length string //currently only works for datastores with char(n) field types MDY 9/00 integer li_DAT*column integer li_pos1, li_pos2 integer li_columnLength, li_dataLength, li_padLength string ls_null string ls_type string ls_data string ls_temp string ls_record any la_data boolean lb_unsupported setNull(ls_null) setNull(la_data) for li_column = 1 to integer(this.Object.DataWindow.Column.Count) lb_unsupported = false //grab the data for the given column ls_type = this.describe("#" + string(li_column) + ".colType") choose case lower(left(ls_type, 5)) case "char(" /*DAT*char(n)*/ ls_data = this.getItemString(al_row, li_column) ls_data = trim(ls_data) //get the column length li_pos1 = pos(ls_type, "(") + 1 li_pos2 = pos(ls_type, ")") ls_temp = mid(ls_type, li_pos1, li_pos2 - li_pos1) li_columnLength = integer(ls_temp) case "decim" /*decimal(n)*/, "int", "long", "numbe" /*number*/, "real", "ulong" lb_unsupported = true exit la_data = this.getItemNumber(al_row, li_column) case "date" lb_unsupported = DAT*true exit la_data = this.getItemDate(al_row, li_column) case "time" lb_unsupported = true exit la_data = this.getItemTime(al_row, li_column) case "datet" /*datetime*/, "times" /*timestamp*/ lb_unsupported = true exit la_data = this.getItemDateTime(al_row, li_column) case else signalError(-1, "Invalid column number '" + string(li_column) + "', or unknown column data type '" + ls_type + "'") exit end choose if lb_unsupported then signalErrorDAT*(-1, "Unsupported column data type '" + ls_type + "'. " +& "Function u_ds_base::of_getRecordString() currently supports only datastores where all columns are 'char(n)'") return ls_null end if //make ls_data the right length by padding it with spaces, if necessary if isNull(ls_data) or len(ls_data) = 0 then ls_data = fill(" ", li_columnLength) else li_dataLength = len(ls_data) li_padLength = li_columnLength - li_dataLength if li_padLength > 0 then ls_data = lDAT*s_data + fill(" ", li_padLength) end if end if //add ls_data to the record string ls_record = ls_record + ls_data next return ls_record end function on u_ds_base.create call datastore::create TriggerEvent( this, "constructor" ) end on on u_ds_base.destroy call datastore::destroy TriggerEvent( this, "destructor" ) end on event dberror; //Handle the DBError event. string ls_message ls_message = "Database Error: " + string(SQLDBCode) + "~r~n~n" + SQLEDAT*rrText messageBox("Database Error", ls_message, exclamation!) return 1 //override default error message end event event constructor; //Set transaction object to SQLCA by default this.setTransObject(SQLCA) end event DAT*  b1<.1P8z%2@281 * . Pd  $conv.tmp<=?@>           !"#$%&'()* +!DAT*,"-#.$/%0&1'2(3)4*5+6,7-8.9/:0;L2  +ue_cleanup+ue_postblockupdate+ue_scanblockof_stripnonprintableof_filecloseof_fileopenof_getdecimalfieldplaceof_getfiledescriptionof_getpathnameof_getstringfieldlengthof_loadfromfileof_registerof_resetof_retrieveappendof_savetofileof_setbasepathnameof_setdatatypeof_setfileaccessof_setfiledescriptionof_setfileheadingsof_setfilenameof_setfiletypeof_setDAT* keepfileopenof_getfieldlimitof_checkcaseof_addrowbaseof_checkformatof_getrecordstringof_fileexistsof_getpathof_setloadblanklinesof_basepathnamesetof_parserecordstringof_setupdateblocksizeof_blockupdateof_resetblocksortkeysof_addblocksortkeyof_getblocksortstringof_filterof_sortof_setfilterlockof_setsortlockof_getblocksortkeynameof_getblocksortkeynumberof_scanblocksof_getitemanyof_buildexpressionof_getcolumntypeof_populatecolumntypesof_trimdataf_sqlcheck+create+destroyDAT*n 1 end event DAT*+dberror+constructor+destructor((6KKXd|      ocnum1_frgsGeroceZma_useDAT*is__idxublicks_gs_s_basemeegspplegrtenvgifilnintwi segetw!ctw_sy"wash_#h$/%E&E'`ÀT(j)PĀ}*+@ŀ,-./DAT*012nc 345678lE$9  X5:L;Xc<k=t>2}?@2  inv_exportis_basefilenameis_masterfileis_tempfileis_extis_dataobjectis_descriptionil_masterhandleil_temphandleie_fileacDAT*cessie_saveastypeib_headingsib_keepfileopenib_loadblanklinesii_masterii_tempil_erroris_erroril_rowerrorib_sortlockib_filterlockis_blocksortkeyil_updateblocksizeil_updatemodifiedcountil_updateblockcountil_updateblocknumberil_updateblockcommitcountil_updatetotalcommitcountis_columntypes$D#1=DRaDAT*q$/0CZDn @/M  DAT*33 P< xhPD}}`T`dDAT*|p |  ` & 2 C|C0`<`HDAT*`d|P @ [P x  | DAT*H$ \P_+Hd ]_!!C|p""C##$$ %%DAT* && ''((8,))1**Q8< ++c8H!,,s`T"--`d#..|p$//`%00DAT*"&11'22(33@()44\D*55`+66,77@-881|.99B /::Y\DAT*0;;=<>=@?> @?L A@DAT*&          4 @  11)81P11R)$811RP4DP |!"#&)d0 as_findll_rowfoundll_rcll_foundcountP ",DAT*( rowcountfindc $ "$1 $8(",$84T$z%8\z&+@+8$8z%)981o@o880$)8V88"8"8"8 "8"$DAT**J,8V84<$)P8V 8XP`$)t8V 8|8"$)8V184$z%8z&z&8z&z&8z&+@+81o2v !"#,$%&' (")L*v+,-0d* as_columnls_typeas_datacaseDAT*32P  "  il_rowis_findData Object: is_dataobjectC. A successful call to of_find() must be made before calling of_getData().colTypedescribe`char(getitemstringmedecimintlongnumberealulonggetitemnumber9dategetitemdate}DtimegetitemtimehdatettimesgetitemdaDAT*.Base class for TreeView with group selection capabilities.forward global type u_tv_selection_tree from treeview end type end forward type ostruct_tvi_data from structure long childcount long selectedchildcount long partialChildCount any data end type global type u_tv_selection_tree from treeview int Width=801 int Height=601 int TabOrder=1 BorderStyle BorderStyle=StyleLowered! boolean LinesAtRoot=true boolean HideSelection=false string PictureName[]={"NotFound!"} long DAT*0PictureMaskColor=553648127 string StatePictureName[]={"tvNselct.bmp",& "tvPselct.bmp",& "tvFselct.bmp"} long StatePictureMaskColor=553648127 long BackColor=16777215 int TextSize=-10 int Weight=400 string FaceName="Arial" FontFamily FontFamily=Swiss! FontPitch FontPitch=Variable! event type long ue_initialize ( ) event type long ue_processselections ( ) event ue_selectionchanged ( ) event type long ue_processallselections ( ) end type global u_tv_selection_tree u_tv_selection_tree DAT*2 type variables //Constant Selection States (used for state picture indexes //and identifying item states) constant integer ii_notSelected = 1 constant integer ii_partSelected = 2 constant integer ii_selected = 3 //Controls the Maximum Tree Depth integer ii_maxTreeDepth = 255 //Array of selected item handles (minimal; if a parent is //selected, a child will not be in the list, since parent //selection implies all children are selected). //Populated by of_getSelectedItems() long ilDAT*4_handleArray[] long il_handleCount = 0 //Flag indicating if redraw is on or off //Set by overloaded function setRedraw() boolean ib_redraw = TRUE //Flag indicating if current handle array is up to date. //Set to TRUE by: // of_getSelectedItems() // of_getAllSelectedItems() //Set to FALSE by: // ue_selectionChanged() -- see event code for comments boolean ib_handleArrayCurrent = TRUE //Flag for descendant class use. Indicates if selections //have been processed. //Set toDAT*6 TRUE by: // (Descendant Class procedures) //Set to FALSE by: // ue_selectionChanged() -- see event code for comments boolean ib_selectionsProcessed = TRUE end variables forward prototypes public function integer of_setitemdata (long al_handle, any aa_data) public function integer of_setitemdata (ref treeviewitem atvi_item, any aa_data) public function integer of_toggleitemstate (long al_handle) protected function integer of_setitemstate (long al_handle, integer ai_state) protecDAT*8ted function integer of_setparentstate (long al_childhandle, integer ai_childstate, integer ai_oldchildstate) public function integer getitem (long al_handle, ref treeviewitem atvi_item) protected function integer of_getitemdata (readonly treeviewitem atvi_item, ref ostruct_tvi_data astruct_data) public function integer setitem (long al_handle, treeviewitem atvi_item) public function long insertitemlast (long al_parenthandle, treeviewitem atvi_item) public function integer of_reset () publicDAT*: function long insertitemfirst (long al_parenthandle, treeviewitem atvi_item) protected function integer of_getallselecteditems (long al_handle) protected function integer of_getselecteditems (long al_handle) public function integer setredraw (boolean ab_redraw) public function long of_insertitem (long al_parenthandle, treeviewitem atvi_item, integer ai_mode) public function long insertitemsort (long al_parenthandle, treeviewitem atvi_item) end prototypes event ue_processselections; //LoDAT*<ad the instance variables il_handleArray[] and il_handleCount. //The handle array will contain the handles of items that are currently //selected. The array is minimized, meaning that if a parent is selected, //its handle will be in the array, but not those of its chidren. This is //because a selected parent implies the selection of all of its children. //NOTE: This script is meant to be extended by descendant classes which //will know exactly what to do with the selections after they aDAT*>re loaded //into the instance array. long ll_rc //call of_getSelectedItems() to populate il_handleCount and il_handleArray[] //(recursive) ll_rc = this.of_getSelectedItems(0) //0 used to indicate start at root level if ll_rc < 0 then return ll_rc return ll_rc end event event ue_selectionchanged; /* This event should be triggered by any procedure that causes item selection states to change. This ensures that the flags ib_handleArrayCurrent and ib_selectionsProcessed DAT*@are set to false, indicating that the tree is out of sync with other data structures. IMPORTANT: Because this event can be triggered many times during item insertion and recursive selection operations, any significant amount of code here could cause performance degredation. Class u_tv_selection_tree triggers this event in the following procedures: of_reset() of_toggleItemState() of_insertItem() -- only when the new item is inserted as a selected item of_setParentState() -- only wDAT*Bhen the "refresh" condition causes a state change */ ib_handleArrayCurrent = false ib_selectionsProcessed = false end event event ue_processallselections; //Load the instance variables il_handleArray[] and il_handleCount. //The handle array will contain the handles of all items that are currently //selected. The array is maximized, meaning that if a parent is selected, //its handle will be in the array, and those of its chidren, too. //NOTE: This script is meant to be exDAT*Dtended by descendant classes which //will know exactly what to do with the selections after they are loaded //into the instance array. long ll_rc //call of_getSelectedItems() to populate il_handleCount and il_handleArray[] //(recursive) ll_rc = this.of_getAllSelectedItems(0) //0 used to indicate start at root level if ll_rc < 0 then return ll_rc return ll_rc end event public function integer of_setitemdata (long al_handle, any aa_data); //Set the data portion of the stDAT*Fructure in treeViewItem.data long ll_rc ostruct_tvi_data lstruct_data treeViewItem ltvi_item //grab the treeViewItem ll_rc = this.getItem(al_handle, ltvi_item) if ll_rc < 0 then return ll_rc //set the data field of the structure and copy back into treeViewItem lstruct_data = ltvi_item.data lstruct_data.data = aa_data ltvi_item.data = lstruct_data //copy treeViewItem back into tree ll_rc = this.setItem(al_handle, ltvi_item) if ll_rc < 0 then return ll_rc return 1 DAT*Hend function public function integer of_setitemdata (ref treeviewitem atvi_item, any aa_data); //Set the data portion of the structure in treeViewItem.data ostruct_tvi_data lstruct_data //grab the data structure lstruct_data = atvi_item.data //set the data field of the structure and copy back into treeViewItem lstruct_data.data = aa_data atvi_item.data = lstruct_data return 1 end function public function integer of_toggleitemstate (long al_handle); treeViewItem DAT*Jltvi_item integer li_rc integer li_itemState integer li_oldItemState boolean lb_prevRedraw setPointer(hourGlass!) //grab the current tree view item and its current state li_rc = super::getItem(al_handle, ltvi_item) if li_rc < 0 then return li_rc li_oldItemState = ltvi_item.statePictureIndex //determine what the item's next state should be if ltvi_item.statePictureIndex = ii_selected then //if item is fully selected, de-select it li_itemState = ii_notSelected else //if iteDAT*Lm is unselected or partially selected, do a full select li_itemState = ii_selected end if //call of_setParentState() to set the state of the item's parent //(recursive) lb_prevRedraw = ib_redraw if lb_prevRedraw then this.setRedraw(false) li_rc = this.of_setParentState(al_handle, li_itemState, li_oldItemState) if lb_prevRedraw then this.setRedraw(true) if li_rc < 0 then messageBox("TreeView Error", "An error occurred in of_setParentState()") return li_rc end if //call of_setItDAT*NemState() to set the state of the item and its children //(recursive) if lb_prevRedraw then this.setRedraw(false) li_rc = of_setItemState(al_handle, li_itemState) if lb_prevRedraw then this.setRedraw(true) if li_rc < 0 then messageBox("TreeView Error", "An error occurred in of_setItemState()") return li_rc end if this.event trigger ue_selectionChanged() return li_itemState end function protected function integer of_setitemstate (long al_handle, integer ai_state); treeViewItDAT*Pem ltvi_item integer li_rc long ll_handle ostruct_tvi_data lstruct_data //grab the tree view item li_rc = super::getItem(al_handle, ltvi_item) if li_rc < 0 then return li_rc //set the statePictureIndex for the item ltvi_item.statePictureIndex = ai_state //set the child count data for the item li_rc = this.of_getItemData(ltvi_item, lstruct_data) if li_rc < 0 then return li_rc if ai_state = ii_selected then lstruct_data.selectedChildCount = lstruct_data.childCount lstruct_dDAT*Rata.partialChildCount = 0 else lstruct_data.selectedChildCount = 0 lstruct_data.partialChildCount = 0 end if ltvi_item.data = lstruct_data //update the item li_rc = super::setItem(al_handle, ltvi_item) if li_rc < 0 then return li_rc //grab the first child of the item ll_handle = this.findItem(childTreeItem!, al_handle) //RECURSION //traverse down through and toggle the state of all children of current item do while ll_handle > 0 //stop recursion condition (end of branch) DAT*T //set the item to the proper selection state (recursive call) li_rc = this.of_setItemState(ll_handle, ai_state) if li_rc < 0 then return li_rc //grab the handle of the next item in the tree ll_handle = this.findItem(nextTreeItem!, ll_handle) loop return ai_state end function protected function integer of_setparentstate (long al_childhandle, integer ai_childstate, integer ai_oldchildstate); //recursive routine for setting item selection states up through //the tree //NoDAT*Vte: calling this function with ai_childState and/or ai_oldChildState set to an invalid //state value causes the parent object to "refresh" itself. The state picture index will be reset //according to the child count data. This is useful when a new item has been inserted with a state //that does not match the parent state. treeViewItem ltvi_item long ll_handle integer li_rc integer li_itemState integer li_oldItemState ostruct_tvi_data lstruct_data //grab the parent item ll_hanDAT*Xdle = this.findItem(parentTreeItem!, al_childHandle) if ll_handle < 0 then return 0 //END OF RECURSION (top of tree) li_rc = super::getItem(ll_handle, ltvi_item) if li_rc < 0 then return li_rc //grab the current state of the item and the data structure li_oldItemState = ltvi_item.statePictureIndex li_rc = this.of_getItemData(ltvi_item, lstruct_data) if li_rc < 0 then return li_rc //update the selected and partial child count fields of the item's data structure choose case ai_oldChildDAT*ZState case ii_selected if ai_childState = ii_partSelected then lstruct_data.selectedChildCount -- lstruct_data.partialChildCount ++ elseif ai_childState = ii_notSelected then lstruct_data.selectedChildCount -- end if case ii_partSelected if ai_childState = ii_selected then lstruct_data.selectedChildCount ++ lstruct_data.partialChildCount -- elseif ai_childState = ii_notSelected then lstruct_data.partialChildCount -- end if case ii_notSelected if aDAT*\i_childState = ii_selected then lstruct_data.selectedChildCount ++ elseif ai_childState = ii_partSelected then lstruct_data.partialChildCount ++ end if end choose ltvi_item.data = lstruct_data //determine the selection state of the current item based on child count data if lstruct_data.selectedChildCount = lstruct_data.childCount then li_itemState = ii_selected elseif (lstruct_data.selectedChildCount = 0) and (lstruct_data.partialChildCount = 0) then li_itemState = ii_notSDAT*^elected else li_itemState = ii_partSelected end if //set the selection state of the parent item ltvi_item.statePictureIndex = li_itemState //copy the item back into the tree li_rc = super::setItem(ll_handle, ltvi_item) if li_rc < 0 then return li_rc //RECURSION //traverse upward through the tree if li_itemState <> li_oldItemState then li_rc = this.of_setParentState(ll_handle, li_itemState, li_oldItemState) if li_rc < 0 then return li_rc this.trigger event ue_selectionChangeDAT*`d() end if return li_itemState end function public function integer getitem (long al_handle, ref treeviewitem atvi_item); integer li_rc ostruct_tvi_data lstruct_data //grab the item li_rc = super::getItem(al_handle, atvi_item) if li_rc < 0 then return li_rc //grab the data structure li_rc = this.of_getItemData(atvi_item, lstruct_data) if li_rc < 0 then return li_rc //extract the data portion of the structure and reassign it to the item atvi_item.data = lstruct_data.datDAT*ba return li_rc end function protected function integer of_getitemdata (readonly treeviewitem atvi_item, ref ostruct_tvi_data astruct_data); //Return the data structure in treeViewItem.data //validate the data structure if className(atvi_item.data) <> "ostruct_tvi_data" then messageBox("Tree View Error", "Function: u_tv_selection_tree::of_getItemData(); " +& "TreeViewItem.data is not of the correct type (ostruct_tvi_data).", exclamation!) return -1 end if //graDAT*db the structure astruct_data = atvi_item.data return 1 end function public function integer setitem (long al_handle, treeviewitem atvi_item); integer li_rc treeViewItem ltvi_item ostruct_tvi_data lstruct_data //grab the item in its current state li_rc = super::getItem(al_handle, ltvi_item) if li_rc < 0 then return li_rc //grab the data structure from the item li_rc = this.of_getItemData(ltvi_item, lstruct_data) if li_rc < 0 then return li_rc //copy data from the DAT*fparameter item into the structure, //and then assign the structure to the parameter item lstruct_data.data = atvi_item.data atvi_item.data = lstruct_data //update the item li_rc = super::setItem(al_handle, atvi_item) return li_rc end function public function long insertitemlast (long al_parenthandle, treeviewitem atvi_item); //Call of_insertItem() with insert mode = 3 (for insert item last) return this.of_insertItem(al_parentHandle, atvi_item, 3) end function public functioDAT*hn integer of_reset (); //delete all root items from the tree long ll_roothandle boolean lb_prevRedraw lb_prevRedraw = ib_redraw if lb_prevRedraw then this.setRedraw(false) this.selectItem(0) do while true ll_rootHandle = this.findItem(rootTreeItem!, 0) if ll_rootHandle < 0 then exit //no more root items this.deleteItem(ll_rootHandle) loop if lb_prevRedraw then this.setRedraw(true) this.trigger event ue_selectionChanged() return 1 end function public functDAT*jion long insertitemfirst (long al_parenthandle, treeviewitem atvi_item); //Call of_insertItem() with insert mode = 1 (for insert item first) return this.of_insertItem(al_parentHandle, atvi_item, 1) end function protected function integer of_getallselecteditems (long al_handle); //Recursive function which traverses the tree and fills in //il_handleArray[] with the handles of all fully selected items. //To begin the recursive call, call the function //with al_handle = 0. long ll_hDAT*landle integer li_rc treeViewItem ltvi_item long ll_empty[] //if handle array is current, don't do anything if ib_handleArrayCurrent then return 0 setPointer(hourGlass!) //initialize the max index and handle array if the given handle is root (0) if al_handle = 0 then il_handleCount = 0 il_handleArray = ll_empty end if //grab the first child of the given item ll_handle = this.findItem(childTreeItem!, al_handle) //traverse down through the tree do while ll_handle > 0 /DAT*n/grab the item li_rc = super::getItem(ll_handle, ltvi_item) if li_rc < 0 then return li_rc //if the item is selected, then add it to the array and increment the index if ltvi_item.statePictureIndex = this.ii_selected then il_handleCount ++ il_handleArray[il_handleCount] = ll_handle end if //continue drilling down if item is fully or partially selected (recursion) if ltvi_item.statePictureIndex <> this.ii_notSelected then li_rc = this.of_getAllSelectedItems(ll_handle) DAT*p if li_rc < 0 then return li_rc end if //get the next tree item ll_handle = this.findItem(nextTreeItem!, ll_handle) loop //set flag to indicate that the current handle array reflects //the all current selections if al_handle = 0 then this.ib_handleArrayCurrent = true return 1 end function protected function integer of_getselecteditems (long al_handle); //Recursive function which traverses the tree and fills in //il_handleArray[] with the handles of criteria items (DAT*ritems that //are selected to form groups). //To begin the recursive call, call the function //with al_handle = 0. long ll_handle integer li_rc treeViewItem ltvi_item long ll_empty[] //if handle array is current, don't do anything if ib_handleArrayCurrent then return 0 setPointer(hourGlass!) //initialize the max index and handle array if the given handle is root (0) if al_handle = 0 then il_handleCount = 0 il_handleArray = ll_empty end if //grab the first child ofDAT*t the given item ll_handle = this.findItem(childTreeItem!, al_handle) //traverse down through the tree do while ll_handle > 0 //grab the item li_rc = super::getItem(ll_handle, ltvi_item) if li_rc < 0 then return li_rc //if the item is selected, then add it to the array and increment the index if ltvi_item.statePictureIndex = this.ii_selected then il_handleCount ++ il_handleArray[il_handleCount] = ll_handle elseif ltvi_item.statePictureIndex = this.ii_partSelected then /DAT*v/item is partially selected, so continue drilling down li_rc = this.of_getSelectedItems(ll_handle) if li_rc < 0 then return li_rc end if //get the next tree item ll_handle = this.findItem(nextTreeItem!, ll_handle) loop //set flag to indicate that the current handle array reflects //all current selections if al_handle = 0 then this.ib_handleArrayCurrent = true return 1 end function public function integer setredraw (boolean ab_redraw); //overloaded function that DAT*xsets the instance variable ib_redraw //and calls ancestor setRedraw(). //returns the previous redraw state represented by an integer: // 0 = false // 1 = true integer li_rc boolean lb_prevRedraw //grab the current state lb_prevRedraw = ib_redraw //set the new state li_rc = super::setRedraw(ab_redraw) if li_rc < 0 then messageBox("Error", "u_tv_selection_tree::setRedraw(); error setting redraw state. " +& "Attempting to set redraw to TRUE due to error.", exclamation!DAT*z) //attempt to set redraw to true to avoid problems ab_redraw = true li_rc = super::setRedraw(ab_redraw) if li_rc < 0 then return li_rc end if //set the new current state ib_redraw = ab_redraw if lb_prevRedraw then li_rc = 1 //old redraw = true else li_rc = 0 //old redraw = false end if return li_rc end function public function long of_insertitem (long al_parenthandle, treeviewitem atvi_item, integer ai_mode); //Insert a tree view item. //Parameter ai_mode detDAT*|ermines the insert mode: // 1 = insert first // 2 = insert sort // 3 = insert last long ll_handle long ll_rc boolean ib_childHasOwnState treeViewItem ltvi_parentItem ostruct_tvi_data lstruct_childData ostruct_tvi_data lstruct_parentData //determine if new item has a valid selection state already if atvi_item.statePictureIndex = ii_selected or atvi_item.statePictureIndex = ii_notSelected then ib_childHasOwnState = true else //no valid state, so assign the default of not seleDAT*~cted ib_childHasOwnState = false atvi_item.statePictureIndex = ii_notSelected end if if al_parentHandle > 0 then //grab the parent item ll_rc = super::getItem(al_parentHandle, ltvi_parentItem) if ll_rc < 0 then return ll_rc //check the level of the parent and make sure the new item //does not exceed max tree depth if ltvi_parentItem.level = ii_maxTreeDepth then return 0 //if new item is at max tree depth then it can't have children if ltvi_parentItem.level = ii_maxTreeDDAT*epth - 1 then atvi_item.children = false atvi_item.expandedOnce = true end if //if the child does not have its own state and the parent is selected, then the child should be selected if not ib_childHasOwnState and ltvi_parentItem.statePictureIndex = ii_selected then atvi_item.statePictureIndex = ii_selected end if end if //set up the data structure for the new item lstruct_childData.childCount = 0 lstruct_childData.selectedChildCount = 0 lstruct_childData.partialChildCounDAT*t = 0 lstruct_childData.data = atvi_item.data //copy the structure into the new item atvi_item.data = lstruct_childData //insert the new item into the tree choose case ai_mode case 1 //insert item first ll_handle = super::insertItemFirst(al_parentHandle, atvi_item) case 2 //insert item sort ll_handle = super::insertItemSort(al_parentHandle, atvi_item) case 3 //insert item last ll_handle = super::insertItemLast(al_parentHandle, atvi_item) case else messageBox("Error", "DAT*u_tv_selection_tree::of_insertItem(); invalid insert mode specified. ", exclamation!) return -1 end choose if ll_handle < 0 then return ll_handle if al_parentHandle > 0 then //update the child count of the parent item ll_rc = this.of_getItemData(ltvi_parentItem, lstruct_parentData) if ll_rc < 0 then return ll_rc lstruct_parentData.childCount ++ if atvi_item.statePictureIndex = ii_selected then lstruct_parentData.selectedChildCount ++ end if ltvi_parentItem.data =DAT* lstruct_parentData //copy parent item back into tree ll_rc = super::setItem(al_parentHandle, ltvi_parentItem) if ll_rc < 0 then return ll_rc //decide if the parent item needs to be "refreshed" //this is the case if an item is inserted with a state that would cause the parent state //to change if ib_childHasOwnState and ltvi_parentItem.statePictureIndex <> ii_partSelected then if ltvi_parentItem.statePictureIndex <> atvi_item.statePictureIndex then ll_rc = this.of_setPareDAT*ntState(ll_handle, 0, 0) //the zeros cause "refresh" behavior if ll_rc < 0 then return ll_rc end if end if end if if atvi_item.statePictureIndex = ii_selected then this.trigger event ue_selectionChanged() end if return ll_handle end function public function long insertitemsort (long al_parenthandle, treeviewitem atvi_item); //Call of_insertItem() with insert mode = 2 (for insert item sort) return this.of_insertItem(al_parentHandle, atvi_item, 2) end function eventDAT*P rightclicked; this.post function of_toggleItemState(handle) end event DAT*return ll_row end if end function on n_ds_cache_base.create call super::create end on on n_ds_cache_base.destroy call super::destroy end on DAT*tetimeC. Invalid column name '', or unknown column data type ''  , T      , < P ` t    J)81:),8(:d ll_rc4 ue_populate2ue_populateend5 , )8d DAT* reset  $1 $8(",$84T$z%8\z&+@+8$8z%)9888"H184$z%8z&z&8z&+@+81$o)8<184 $z%8z&z&8z&+DAT*@+8112v !"#<&H'x(),d( as_columnaa_datals_typell_rcP  "=P il_rowis_findData Object: is_dataobjectC. A successful call to of_find() must be made before calling of_setData().colTypedescribe`?!C. Invalid column name ''setitemDAT*C. Call to setItem() failed for column '  , T        `,4$6, )L8<<d as_dataobjectsqlca(  @T is_dataobjectdataobject settransobjectb< , 4 L D@86DAT*o)8d as_actionaa_data(  of_scan@ D@86o)8d as_actionaa_data(   of_scanreverse? )8),8J116o)@8DAT*1:)T811 #*&Z(*./269;<>d3 as_actionaa_datall_rowll_rcll_rowcountd !'\ ue_scanbegin3rowcount ue_scanrow14ue_scanend4H , @ T )8)DAT*,81F6o)@81<)T81 *#T%|'+,/3689;d3 as_actionaa_datall_rowll_rowcountll_rcd !-\ ue_scanbegin3rowcount ue_scanrowDAT*14ue_scanend4H , @ T 8d  create8d  destroy 123456789: ; < = >?@L2 +ue_scanrow+ue_populate+ue_scanbegin+ue_scanend+ue_populateendof_findof_findnextof_getcountof_getdataof_populateof_resetDAT*of_setdataof_setdataobjectof_scanof_scanreverse+create+destroy|!/;KS_kv     2  is_findil_row(DAT*M  n383!,1-12:3x3H34T35DAT*lD86tG7XL8h\91: k p; X< X= X> DAT*? @ 3 3DAT*0T"r&)*-/1dB al_handleai_stateltvi_itemli_rcll_handlelstruct_datax %+5 h getitemL of_getitemdataf selectedchildcount8childcountTpartialchildcounth8hsetitemYfinditemf_sKof_setitemstatedK  0 L `DAT* |        (:V@)81B1)$8}1<,$})D8}1< }/ V/0`|R/R/ //DAT*/ //*V$$h/}$1$1!/}/}}*)8}1<p)8}1<^)08"BfDAT* !"#$,%>'R(d)r*+,./0125869X:d;<=ADEIJK@L^Opd al_childhandleai_childstateai_oldchildstateltvi_itemll_handleli_rcli_itemstateli_olditemstatelstruct_datacase31%6 @JP]m z8 finditem)DAT*KgetitemL of_getitemdataf4selectedchildcountLpartialchildcounthLLhhLhLchildcountLh setitemYof_setparentstateeue_selectionchanged_ $ , D ` |               0 )8}DAT*1<>-)(8}1<-0@V > bd/ al_handleatvi_itemli_rclstruct_dataP " H getitemLof_getitemdatafdatamda8 ( 0 @ @988x8!0818eDAT*z%:)@@81g14 h xd atvi_itemastruct_data(   ostruct_tvi_dataTree View ErrorFunction: u_tv_selection_tree::of_getItemData(); TreeViewItem.data is not of the correct type (ostruct_tvi_data).  )8}1<B)(DAT*8}1<8@VH*V*)X8} $ Bfd9 al_handleatvi_itemli_rcltvi_itemlstruct_datad " , `0 getitemLof_getitemdataifdata0setitemYP ( 8 @ H DAT*X 2*1)8d" al_parenthandleatvi_item(   of_insertitemj  $}29)(81)<89:V@1)P81)d8J9)l8)81  2JRvd$DAT* ll_roothandlelb_prevredraw(8 ib_redraw4setredraw!selectitemV0finditemKDdeleteitemGX!ue_selectionchanged_t ( < P d l  2*1)8d" al_parenthandleatvi_item(   of_insertitemj  $DAT* 1:F@@81x81P|:V@)d81)t8}1<|$/:$$ $/)8}1<:V@)819}1 :J`DAT*x !$%&*:+R,n0268dD al_handlell_handleli_rcltvi_itemll_empty8d" 8,-h ib_handlearraycurrent5il_handlecount(3il_handlearray@2finditemKXgetitemLl (3@2(3 of_getallselecteditemshKX5 8 P d tDAT* |         $ 1:F@@81x81P|:V@)d81)t8}1<|$/>$$ $/)8}1<:V@)DAT*819}1 :J`x!"%&'(:*V+r/157dD al_handlell_handleli_rcltvi_itemll_emptyt8d" 8,-h ib_handlearraycurrent5il_handlecount(3il_handlearray@2finditemKXgetitemLl (3@2(3DAT* of_getselecteditemsiKX5 8 P d t |         $})(8}1<800868vz%:)@@89})8}1<}1}1}0Dx !"#&d&DAT* ab_redrawli_rclb_prevredraw< ib_redraw4setredraw!Erroru_tv_selection_tree::setRedraw(); error setting redraw state. Attempting to set redraw to TRUE due to error.f_g!4 (   .$/$/">9}`9}/}1p)(8<1DAT*0$H$1P$X$1<Y<:`9}h9}#p$/!px/}111V*V }1 <>*)81 <z*)81 <*)DAT*,88408:0:)@@811 1)8<1\$/*V*)8<1$/!$$11)8<1$/DAT*)8.:>J`p!$%&$*:+Z0p12369:;<:=R>v?@ABEG IJBL\NpOQTUZ[\:]ncdgd al_parenthandleatvi_itemai_modell_handlell_rcib_childhasownstateltvi_parentitemlstruct_childdatalstruct_parentdatacase57 "*4:DAT*N ^ p     getitemL ii_maxtreedepth81 81  childcountselectedchildcountpartialchildcount0datainsertitemfirstQinsertitemsortUinsertitemlastSErroru_tv_selection_tree::of_insertItem(); invalid insert mode specified. of_getitemdatafDAT* setitemY   of_setparentstatee ue_selectionchanged_   ( 0 H P X ` h p x         ,             2*1)8d" al_parenthandleatvi_item(DAT*   of_insertitemj J)8,01>,$$d handle::message(@, of_toggleitemstatec $ !:L QS UY ]^_`abcdef g hij":2 F +ue_initialize+ue_proceDAT*ssselections+ue_selectionchanged+ue_processallselectionsof_setitemdataof_toggleitemstateof_setitemstateof_setparentstategetitemof_getitemdatasetiteminsertitemlastof_resetinsertitemfirstof_getallselecteditemsof_getselecteditemssetredrawof_insertiteminsertitemsort+rightclicked-B[[j} DAT*    )82 v widthheighttaborderborderstylelinesatroothideselectionpicturename picturemaskcolorstatepicturename statepicturemaskcolorbackcolortextsizeweightfacenamefontfamilyfontpitchii_notselectedii_partselectedii_selectedii_maxtreedepDAT*thil_handlearrayil_handlecountib_redrawib_handlearraycurrentib_selectionsprocessedP$!Y*6PD1\ m1 iDAT*$/0or? I_] o!Y E@i @@@@@@P1 1DAT* 3]^- x_B`m$ am@(b`Tc|ddeDAT*L f ,Y .X@S =ig FXlQ V`hm`i!jXUDAT*l 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) // ************************************************************************* case "ACTION 2" // *****************************************************************DAT*forward global type w_data_viewer from Window end type type st_1 from statictext within w_data_viewer end type type dw_1 from datawindow within w_data_viewer end type end forward global type w_data_viewer from Window int X=27 int Y=48 int Width=3538 int Height=2240 boolean TitleBar=true string Title="Data Viewer" long BackColor=79741120 boolean ControlMenu=true WindowType WindowType=response! st_1 st_1 dw_1 dw_1 end type global w_data_viewer w_data_viewer event open; datDAT*awindow ldw_data datastore lds_data string ls_dataObject if not isValid(message.powerObjectParm) then messageBox("Error", "Message object must contain a valid datawindow or datastore object reference.", exclamation!) close(this) end if choose case message.powerObjectParm.typeOf() case dataWindow! ldw_data = message.powerObjectParm dw_1.dataObject = ldw_data.dataObject ldw_data.shareData(dw_1) this.title = this.title + ": " + ldw_data.dataObject st_1.text = string(ldwDAT*_data.rowCount()) + " Rows" case dataStore! lds_data = message.powerObjectParm dw_1.dataObject = lds_data.dataObject lds_data.shareData(dw_1) this.title = this.title + ": " + lds_data.dataObject st_1.text = string(lds_data.rowCount()) + " Rows" case else messageBox("Error", "Message object must contain datawindow or datastore object.", exclamation!) end choose return 1 end event on w_data_viewer.create this.st_1=create st_1 this.dw_1=create dw_1 this.ControlDAT*[]={this.st_1,& this.dw_1} end on on w_data_viewer.destroy destroy(this.st_1) destroy(this.dw_1) end on type st_1 from statictext within w_data_viewer int X=37 int Y=32 int Width=1938 int Height=80 boolean Enabled=false boolean FocusRectangle=false long TextColor=33554432 long BackColor=67108864 int TextSize=-10 int Weight=700 string FaceName="Arial" FontCharSet FontCharSet=Ansi! FontFamily FontFamily=Swiss! FontPitch FontPitch=Variable! end type type dw_1 from datawinDAT*dow within w_data_viewer int X=37 int Y=112 int Width=3438 int Height=1984 int TabOrder=10 BorderStyle BorderStyle=StyleLowered! boolean HScrollBar=true boolean VScrollBar=true boolean LiveScroll=true end type DAT********* function_2() // ************************************************************************* case "ACTION 3" // ************************************************************************* . . . // ************************************************************************* case else // ************************************************************************* //default action or error signalError(-1, "Unknow action '" + as_action + "' for ue_scanRow().") DAT* return -1 end choose */ return 0 end event public function integer of_retrieveappend (any aa_arg1);//******************************************************************************** // // 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 // //**************************DAT******************************************************* // Revision History // Date Name Revision //-------------------------------------------------------------------------------- // 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, laDAT*_null, la_null, la_null, 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, 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);//******************************************************************************** // // Object: n_ds_conversion_base inherited from datastore // Function: oDAT*f_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: // Retrieve data and append to this datastore. Will accept up to 8 retrieval // arguments. // //******************************************************************************** // Revision History // Date Name Revision //----------DAT*---------------------------------------------------------------------- // 10/26/2000 Mark Young Initial Version //******************************************************************************** string ls_dw_syntax, ls_sql, ls_error long ll_rc long ll_rows datastore lds_temp ls_sql = this.Describe("DataWindow.Table.select") ll_rc = rowcount() if ll_rc > 0 then //we already have rows, so use temp datastore to get //the next set of rows and append //create the temp datastore lDAT*ds_temp = create datastore if not isValid(lds_temp) then signalError(-1, "Failed creating ids_temp") return -1 end if lds_temp.dataObject = this.dataObject 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 ls_sql = this.Describe("DataWindow.Table.select") ls_sql = f_stringglobalreplace(ls_sql, '"', '~"', false) ls_DAT*sql = f_stringglobalreplace(ls_sql,"'", "~~~'", false) ls_dw_syntax = "DataWindow.Table.select='" + ls_sql + "'" //ll_rc = lds_temp.setsqlselect( ls_sql) ls_error = lds_temp.Modify(ls_dw_syntax) IF len(ls_error) > 0 and not isnull(ls_error) THEN MessageBox('Retrieve Append Failed','Select unchanged. Contact Technical Support.') return -1 END IF //grab a copy of the current transaction object //and give it to the temp datastore //messageBox("Development", "Fix copy transDAT* functionality to non-pfc") //will need to add pfc-like instance transaction reference and of_setTransObject function //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,aa_arg9, aa_arg10, aa_arg11, aa_arg12, aa_arg13) if ll_rows < 0 then destroy lds_temp signalError(ll_rows, "Retrieve() failed for lds_temp") return -1 end if //append the temp rows to the main datastore if ll_rows > 0 then DAT* 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, aa_arg2, aa_arg3, aa_arg4, aa_arg5, aa_arg6, aa_arg7, aa_arg8,aa_arg9, aa_arg10, aa_arg11, aa_arg12, aa_arg13) if DAT*ll_rows < 0 then signalError(ll_rows, "Retrieve() failed") return -1 end if end if return ll_rows return 1 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: public // Arguments: string as_action // any aa_data // Returns: long // 0 iDAT*f 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. // //******************************************************************************** // Revision History // Date Name Revision //-------------------------------DAT*4------------------------------------------------- // 10/12/2000 Mark Young Initial Version //******************************************************************************** long ll_row long ll_rc //trigger the begin scan event for any pre-processing this.trigger event ue_scanBegin() //loop through datastore for ll_row = 1 to this.rowCount() //call ue_scanRow() with requested action ll_rc = this.trigger event ue_scanRow(ll_row, as_action, aa_data) if ll_rc < 0 then DAT*forward global type w_debug_text from Window end type type mle_1 from multilineedit within w_debug_text end type end forward global type w_debug_text from Window int X=78 int Y=32 int Width=3406 int Height=2224 boolean TitleBar=true string Title="Debug Text" long BackColor=79741120 boolean ControlMenu=true WindowType WindowType=response! mle_1 mle_1 end type global w_debug_text w_debug_text on w_debug_text.create this.mle_1=create mle_1 this.Control[]={this.mle_1} end on DAT* on w_debug_text.destroy destroy(this.mle_1) end on event open; mle_1.text = message.stringParm end event type mle_1 from multilineedit within w_debug_text int X=37 int Y=32 int Width=3310 int Height=2048 int TabOrder=10 BorderStyle BorderStyle=StyleLowered! boolean HScrollBar=true boolean VScrollBar=true boolean HideSelection=false boolean DisplayOnly=true long TextColor=33554432 int TextSize=-10 int Weight=400 string FaceName="Arial" FontCharSet FontCharSet=Ansi! FoDAT*GntFamily FontFamily=Swiss! FontPitch FontPitch=Variable! end type DAT*:"2  2 = childcountselectedchildcountpartialchildcountdataP&8DAT* ) 88(z&z&)@8<@d$ ads_exportas_messagell_rc<  H of_getfiledescriptionrr: of_writelogmessage, @ L) 88(z&)L8<8d ads_exportll_rc( T of_getfiledescriDAT*ption: Exporting...of_writelogmessage8 L H80),81}<<2<=@$8H.<=L$8Tz%<=d$(@(8z(8lz&<=$(@(8z(8z&)821R $.'2d2 li_indexls_descriptionll_rowsll_errorsDAT*P  (0 EXPORT TOTALS:of_writelogmessagedescription44: row_countX records written. error_count records in error., @ L d   ~#D180+@+81@$P61 4Dhd as_messageDAT* X Invalid window reference sw_export.sle_export_status,9BtextH@ P ) 88(B11}b<<=8$X<D<%@6<%T)h8<%|$<%)8DAT*<%$12Bx!$&'()@+D,v/d+ ads_exportli_indexls_description<  X of_getfiledescriptiondescription))row_countHrowcount\error_countpil_rowerrorH\p 8 @ T h |  DAT*    5@85.@.85@85.@.833#@#8 44 @ 8 1Q` R 5Ik11H 80Z 80  1Q` (@(88z& 5(Ik1 DAT* 1` 50Ik1(  1<`  880)@)8z'880)@)8z( 8<0)@)8z( 6!""#D$f&'*-./"021D2H5Z6t:;=ABDG(Ld adt_startadt_endld_enddaylt_endtimeld_startdaylt_starttimell_elapseddaysll_elapsedhoursll_elapsedminutesll_elapsedsecondsls_elapsedtimels_dayssecoDAT*nds_in_dayseconds_in_hourseconds_in_minute,   $ / ; HWgy Q<? ) @ days day ( @N@00:00(01d DAT* 1} <<=#^1<=)81<116N^ "d li_i of_reset (D@D$d  1<"*6<B@B98DAT*z(<@98*d+ as_mainstringai_lengthas_padwith<   &|1d( lstr_recordcount* - J1R}< 14d! anv_cacheobjectli_index(DAT*   ^8),8z'84z&z&)L8<Jd$ ads_exportas_messagell_rc<  T *Warning: of_getfiledescription: of_writelogmessage8, L )8d  ue_initialize >8DAT*"z%)(8<*d as_messagell_rc( 0 *Error: of_writelogmessage( >8z%)(8<*d as_messagell_rc( 0 *Warning: of_writelogmessage( "80)$8d ,DAT*$ constructortriggerevent $ "80) 8d ( destructortriggerevent   #j #d18(0+@+81)X88`08d0)8)81 $0X"d%zd n_ds_conversion_baseFailed DAT*&creating Log File datastore.of_registerLlogd_ds_log_fileof_setdatatyperof_synchronize X   L1<*1:1 *4Q:d     ! " #$%&'()*+,-L2  +ueDAT*(_synchronize+ue_initializeof_writelogmessagemidcountof_setexportwindowof_setrunof_synchronizeof_writelogmessageof_writelogmessageendof_writelogmessageerrorof_writelogmessagemidof_writelogmessagestartof_writelogtotalsof_writestatusmessageof_addtototalsof_elapsedtimeof_exportof_flushcacheof_getrunof_leftpadof_resettotalsof_addtoflusharrayof_writelogmessagewarningof_initialize+create+destroy+constructor+destructorD'DAT**BU_n     #-;EPasnstr_gt_padrftof_raacheadlushrrigmesgnitin_od_ca_eDAT*,liaic2 3 iw_exportcrlfids_logfileis_errormessageP#M I0 xnXLpd tDAT*.   "! 8 " Y0# h $r %DAT*04&\8' (pd)* +,-#DAT*TL0DAT*t FFo] o%    E @@ @1DAT*6 //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 > this.rowCount() 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_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() returnDAT*:s null, then 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 DAT*<//trigger the begin scan event for any pre-processing this.trigger event ue_scanBegin() //loop through datastore backwards for ll_row = this.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 //trigger the end scan event DAT*>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_scanreverse (string as_action);//******************************************************************************** // // Object: n_ds_cache_base inherited from n_ds_conversion_base // Function: of_scanReverse // Access: public // Arguments: string asDAT*@_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*B----------------- // 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_scan (string as_action);//******************************************************************************** // // ObjeDAT*Dct: 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 if 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. // //**************************************************************************DAT*F****** // Revision History // Date Name Revision //-------------------------------------------------------------------------------- // 10/12/2000 Mark Young Initial Version //******************************************************************************** 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 event constructor; //Set transaction objDAT*ect to SQLCA by default this.setTransObject(SQLCA) end event event dberror; //Handle the DBError event. //string ls_message // // //ls_message = "Database Error: " + string(SQLDBCode) + "~r~n~n" + SQLErrText // //messageBox("Database Error", ls_message, exclamation!) // return 1 //override default error message end event on u_dw_base.create end on on u_dw_base.destroy end on DAT*Jp@)b?:A p@p@t p@q@@q"\@\@a-[@[@a9c@c@qFU@U@aW`@`@qaj@j@qok@k@{l@l@m@m@q@@Q@@@@@@^@^@q@@`@@a@@)@@4@@>@@J@@Vn@n@a@@o@o@Av@v@@;@;@d@d@ w_data_viewerwindowmenuwindowtypewindowstatewindowobjecttoolbaralignmeDAT*Lntstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobject  8 statictextfontcharsetfontpitchfontfamilyalignmentfillpatternborderstyledatawindowdwobjectData Viewer  (Arialdatastoremessageobjectdragobjectx2 w_data_viewer  +open+create+destroy DAT*N LQ xy _initsrcwindoww_data_viewermenuwindowtypewindowstatewindowobjecttoolbaralignmentstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectstatictextst_1fontcharsetfontpitchfontfamilyalignmentfillpatternborderstyledatawindowdw_1dwobjectdatastoremessageobjectdragobject anf_safi@pepinstp&f_@aren+rt@DAT*Puof6t@saveBri@f_exOs_@ltyp`le@uof_jps@elux ve@f_ex vi@ @ @ @@@@@@/@&@@$@80!@!<@GLa@!U@DAT*R_<@gni@ntwinse@ wW ,*. y%,$#Z8080:)@@8@8,d$)t8:;@t,|$$$6$)8DAT*T$8z%$z&$)8(@(88$z&:;@j,,$4$<D$6L$)T8\d$8z%l$z&t$|)8(@(88$z&8080:)@@81D Z ~ (pDAT*Vfjd8 ldw_datalds_datals_dataobjectmessagecase11d   (@0 ^@ErrorMessage object must contain a valid datawindow or datastore object reference. ^@typeofcl ^@dw_1+dataobject+sharedatatitle  : st_1*text@!rowcount@4 Rows! DAT*X^@++  *Message object must contain datawindow or datastore object. d t |            , 4 < D L T \ d l t |  b*(*0@H$P$ |,d DAT*Z X8 st_1*dw_1 + control8c@* + ( 0@ H P "$ $d ( st_1*dw_1+  &&2  +open+create+destroy< hebactuskcotc2 S xywidthheighttitlebartitlebackcolorcontrolmenuwindoDAT*\wtypest_1dw_1 0 "j(2>I N ] o0 j  x1  @@DAT*^@  &  x2  2 ~ xywidthheightenabledfocusrectangletextcolorbackcolortextsizeweightfacenamefontcharsetfontfamilyfontpitch%q c@ PqDAT*`l@!0a:@DMqT@] i t ] o% P      @2  2 O xywidthheighttabDAT*orderborderstylehscrollbarvscrollbarlivescroll% p n  ".9D] o%pn   @  @  DAT*dn@@:An@n@T n@@@q)@@A2`@`@<j@j@Jk@k@Vl@l@jm@m@av@@a@@@@q@@q^@^@o@o@q@q@a`av@v@@@ u_dw_basedatawindowborderstyledwobjectstructuremailrecipientenvironmentmailfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatastoretransacDAT*ftionsqlcaf_stringglobalreplacemessagedwbuffer2 u_dw_base - +ue_scanend+ue_scanbeginal_rowas_actionaa_data+ue_scanrowaa_arg1of_retrieveappendaa_arg2aa_arg3aa_arg4aa_arg5aa_arg6aa_arg7aa_arg8aa_arg9aa_arg10aa_arg11aa_arg12aa_arg13of_scanof_scanreverse+constructorsqldbcodesqlerrtextsqlsyntaxbufferrow+dberror+create+destroy@ Qy")3LLSAtroGIAeGDAT*haiqyLAAAAAAAAAAAAAl)3LSA)3)LS)LLLSSCdwbuffer.L 8H (8H x _initsrcdatawindowu_dw_baseborderstyledwobjectstructuremailrecipientenvironmentmaDAT*jilfiledescriptionmailmessagedatawindowchildlistviewitemtreeviewitemconnectioninfopowerobjectdatastoretransactionmessagedwbuffer| etwin.d@rintenints&Se@sysp2hs@getw;ct@kernEWi@sDirSst@ror_e@n+cste@stro !`@@ @@ @rue Co@3355 Te@ze=-ig@00 eN@"Ariha@ FDAT*lonns@  (      1Ud! al_rowas_actionaa_data<  |@8ooooooooooooo) 8hd aa_arg1ll_rcla_null<DAT*n$ of_retrieveappend `)8),8)@81jT#18\0+@+81x$6,)8<1D8$6(@(8z'+@+818)8680809 DAT*p8680809 8 8z%8z& )81#!f8$08;0@81oooooooooo o o o )t 818|0+@+8111:@)81R:@)8<180DAT*r+@+81Doooooooooo o o o ) 81D80+@+811 6%F&T'`(*,-./083D4b5689:2;ZDfEFGHLM NZOjPpQUVY\]^_8dDhNd aa_arg1aa_arg2aa_arg3aa_arg4aa_arg5aa_arg6aa_arg7aa_arg8aa_arg9aa_arg10aa_arg11aDAT*ta_arg12aa_arg13ls_dw_syntaxls_sqlls_errorll_rcll_rowslds_tempsqlca (08@HPYbkt    @h DataWindoDAT*vw.Table.selectdescribej rowcount44datastoreHFailed creating ids_tempdataobjectsettransobjectSetTransObject() failed for lds_temp. DataObject = j "'~'DataWindow.Table.select='modifyRetrieve Append FailedSelect unchanged. Contact Technical Support.retrievehRetrieve() failed for lds_temp44rowscopyRowsCopy() failed for lds_temp2hRetrieve() failed, @ TDAT*xx      t     )81.),86o)@81$)T8)\81 #H%p'+,/3689;d' as_actionaa_datall_rowll_rcP !DAT*zd( ue_scanbeginblerowcount4 ue_scanrow4ue_scanendH4  , @ T \  )8),8>116o)@81.)T811!$N&v(,-0479:<d' as_actionaa_datall_rowll_rcPDAT*| !\ ue_scanbeginrowcount4 ue_scanrow4ue_scanendH , @ T D@86o)8d as_actionaa_data(   of_scanreverse D@86o)8dDAT*~ as_actionaa_data(  of_scan J,)8,01>, $d sqlca::message(@@( settransobject^  1 d2 sqldbcodesqlerrtextsqlsyntaxbufferrowd DAT* '. d  d   % & L%&2 +ue_scanend+ue_scanbegin+ue_scanrowof_retrieveappendof_scanof_scanreversef_stringglobalreplace+constructor+dberror+create+destroy,"..DAT*@HH@WWm z   2 B widthheighttaborderlivescrollis_sqlib_retrieveappendxh)0] oh DAT*@  @ @ ;0 xOD8OH   4(DAT*48D% LH&  $