|
pfc_save
|
|
Full name
|
pfc_u_rte.pfc_save
|
Access
|
public
|
Extend of
|
integer
|
Return value
|
integer
|
Prototype
|
event integer pfc_save()
|
Name
|
Datatype
|
le_filetype
|
filetype
|
li_rc
|
integer
|
ls_dirpath
|
string
|
ls_drive
|
string
|
ls_ext
|
string
|
ls_filename
|
string
|
ls_filetosave
|
string
|
ls_path
|
string
|
event pfc_save;//////////////////////////////////////////////////////////////////////////////
//
// Event: pfc_save
//
// Arguments: none
//
// Returns: integer
// 1 = successful save performed
// 0 = Save not perfomed
// -1 = Save failed
//
// Description: Issues a save for the RTE, using the is_filename property
//
//////////////////////////////////////////////////////////////////////////////
//
// 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_drive
string ls_dirpath
string ls_filename
string ls_path
string ls_ext
string ls_filetosave
filetype le_filetype
//////////////////////////////////////////////////////////////////////////////
// If filename has not been defined, then let user enter a filename
//////////////////////////////////////////////////////////////////////////////
if Len (is_filename) = 0 then
if GetFileSaveName ("Save", ls_path, ls_filename, "", &
"Rich Text Format (RTF),*.rtf,Text Document,*.txt") < 1 then
return 0
else
ls_filetosave = ls_path
end if
else
ib_ignorefileexists = true
ls_filetosave = is_filename
end if
//////////////////////////////////////////////////////////////////////////////
// Determine extension of filename to save
//////////////////////////////////////////////////////////////////////////////
f_SetFilesrv (inv_filesrv, true)
inv_filesrv.of_ParsePath (ls_filetosave, 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
//////////////////////////////////////////////////////////////////////////////
// Save file
//////////////////////////////////////////////////////////////////////////////
li_rc = SaveDocument (ls_filetosave, le_filetype)
ib_ignorefileexists = false
if li_rc = 1 then
is_filename = ls_filetosave
return 1
else
return li_rc
end if
end event