of_load


pfcdwsrv.pbl   >   pfc_n_cst_dwsrv_querymode   >   of_load   

Full name pfc_n_cst_dwsrv_querymode.of_load
Access public
Extend of integer
Return value integer
Prototype public function integer of_load(string,ref string,ref string,string,string)

Name Datatype
No Data

Name Datatype
lb_enabled boolean
li_value integer

public function integer of_load (string as_title, ref string as_pathname, ref string as_filename, string as_ext, string as_filter);//////////////////////////////////////////////////////////////////////////////
//
//	Function:  of_Load
//
//	Access:  public
//
//	Arguments:
//	as_title   title of the load dialog
//	as_pathname   string variable into which you want to store the returned path and filename. 
//	as_filename   string variable in which you want to store the returned filename
//	as_ext   string whose value is a 1 to 3 character default file extension
//   as_filter   string whose value is a text description of the files to include
//		in the listbox and the file mask that you want to use to select the displayed files
//		(for example, *.* or *.exe)
//
//	Returns:  integer
//	 1 = The load was successful
//	 0 = The user hit the Cancel button or Windows cancels the display
//	-1 = error
//
//	Description:
//	To load a saved query criteria from disk.
//	This function will set QueryMode to "yes" if a file is chosen in the File Open dialog
//
//////////////////////////////////////////////////////////////////////////////
//
//	Revision History
//
//	Version
//	5.0   Initial version
//
//////////////////////////////////////////////////////////////////////////////
//
//	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.
//
//////////////////////////////////////////////////////////////////////////////
integer 	li_value
boolean	lb_enabled

// Verify passed arguments
if IsNull (as_title) or IsNull (as_ext) or IsNull (as_filter) then return -1  

// Check the datawindow reference
if IsNull(idw_requestor) Or not IsValid (idw_requestor) then
	return -1
end if

// Prompt the user with a File Open dialog.
li_value = GetFileOpenName (as_title, as_pathname, as_filename, as_ext, as_filter) 

// If the user choses a file, then use it to load into the QueryMode datawindow
if li_value = 1 then
	idw_requestor.SetReDraw (false) 
	
	lb_enabled = of_GetEnabled()
	if not lb_enabled then
		of_SetEnabled (true)
	end if

	// Clear prior QueryMode criteria if necessary
	if ib_resetcriteria then idw_requestor.Object.DataWindow.QueryClear = "yes"

	// Load the query
 	if idw_requestor.ImportFile (as_pathname) <= 0 then
		li_value = -1
	end if
	 
	idw_requestor.SetReDraw (true) 
end if

return li_value
end function

     
Name Owner
pfc_n_cst_dwsrv_querymode.of_load pfc_n_cst_dwsrv_querymode
pfc_n_cst_dwsrv_querymode.of_load pfc_n_cst_dwsrv_querymode

     
Name Owner
dragobject.setredraw dragobject
datawindow.importfile datawindow
systemfunctions.getfileopenname systemfunctions
systemfunctions.isnull systemfunctions
systemfunctions.isvalid systemfunctions
pfc_n_cst_dwsrv_querymode.of_getenabled pfc_n_cst_dwsrv_querymode
pfc_n_cst_dwsrv_querymode.of_setenabled pfc_n_cst_dwsrv_querymode

     
Full name
No Data

     
Name Scope
No Data