pfc_saveas


pfcmain.pbl   >   pfc_u_rte   >   pfc_saveas   

Full name pfc_u_rte.pfc_saveas
Access public
Extend of integer
Return value integer
Prototype event integer pfc_saveas()

Name Datatype
No Data

Name Datatype
le_filetype filetype
li_rc integer
ls_dirpath string
ls_drive string
ls_ext string
ls_filename string
ls_path string

event pfc_saveas;//////////////////////////////////////////////////////////////////////////////
//
//	Event:  pfc_saveas
//
//	Arguments:  none
//
//	Returns:  integer
//	 1 = successful saveas performed
//	 0 = SaveAs not perfomed
//	-1 = SaveDocument failed
//
//	Description:  Issues a SaveAs for the RTE
//
//////////////////////////////////////////////////////////////////////////////
//	
//	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.
//
//////////////////////////////////////////////////////////////////////////////

integer	li_rc
string		ls_path
string		ls_filename
string		ls_dirpath
string		ls_drive
string		ls_ext
filetype	le_filetype

ls_path = is_filename
if GetFileSaveName ("Save As", ls_path, ls_filename, "", &
	"Rich Text Format (RTF),*.rtf,Text Document,*.txt") = 1 then

	// Determine file extension used
	if Len (ls_filename) > 0 then
		f_SetFilesrv (inv_filesrv, true)
		inv_filesrv.of_ParsePath (ls_path, ls_drive, ls_dirpath, ls_filename, ls_ext)

		// Determine whether to save as rich text or text
		if Upper (ls_ext) = "RTF" then
			le_filetype = filetyperichtext!
		else
			le_filetype = filetypetext!
		end if

		if this.SaveDocument (ls_path, le_filetype) = 1 then
			is_filename = ls_path
			li_rc = 1
		else
			li_rc = -1
		end if
	else
		this.event pfc_saveas()
	end if
end if

return li_rc

end event

     
Name Owner
pfc_u_rte.pfc_saveas pfc_u_rte

     
Name Owner
richtextedit.savedocument richtextedit
systemfunctions.getfilesavename systemfunctions
systemfunctions.len systemfunctions
systemfunctions.upper systemfunctions
pfc_n_cst_filesrv.of_parsepath pfc_n_cst_filesrv
f_setfilesrv.f_setfilesrv f_setfilesrv
pfc_u_rte.pfc_saveas pfc_u_rte

     
Full name
No Data

     
Name Scope
No Data