clicked


pfcutil.pbl   >   pfc_u_tabpg_dwproperty_srvsyntax   >   cb_save   >   clicked   

Full name pfc_u_tabpg_dwproperty_srvsyntax.cb_save.clicked
Access public
Extend of
Return value
Prototype event clicked()

Name Datatype
No Data

Name Datatype
li_filenumber integer
li_rc integer
ls_filename string
ls_path_filename string
ls_text string
TITLE string

event clicked;call super::clicked;//////////////////////////////////////////////////////////////////////////////
//
//	Event:  clicked
//
//	Arguments:  None
//
//	Returns: None
//
//	Description:
//	 Saves the current text to a file.
//	 Opens the GetFileSaveName dialog window, gets a filename, and allows 
//	 for the saving of text to the file.
//
//////////////////////////////////////////////////////////////////////////////
//	
//	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.
//
//////////////////////////////////////////////////////////////////////////////

constant string TITLE='Save PowerScript File'
string	ls_path_filename
string	ls_filename
string	ls_text
integer	li_rc
integer	li_filenumber

SetPointer(HourGlass!)

//Get the filename
li_rc = GetFileSaveName  (TITLE, ls_path_filename, ls_filename, & 
				'TXT', 'Text Files (*.TXT), *.TXT' )

If li_rc > 0 Then
	
	If FileExists (ls_path_filename) Then
		//Existing file has been found
		If of_MessageBox ('pfc_dwpropertysyntax_replacefile', TITLE, &
			'Replace existing file '+ls_path_filename, &
			Question!, YesNo!, 1) = 2 Then
			//Do not replace the file
			Return 1
		End If
	End If
	
	//Write the history to the file
	SetPointer (HourGlass!)
	li_filenumber = FileOpen(ls_path_filename, StreamMode!, Write!, LockWrite!, Replace!)
	If li_filenumber > 0 Then
		ls_text = mle_syntax.Text
		FileWrite (li_filenumber, ls_text)	
		FileClose (li_filenumber)
	End If
	
End If

Return li_rc

end event

     
Name Owner
No Data

     
Name Owner
systemfunctions.fileclose systemfunctions
systemfunctions.fileexists systemfunctions
systemfunctions.fileopen systemfunctions
systemfunctions.filewrite systemfunctions
systemfunctions.getfilesavename systemfunctions
systemfunctions.setpointer systemfunctions
pfc_u_cb.of_messagebox pfc_u_cb
commandbutton.clicked commandbutton

     
Full name
pfc_u_tabpg_dwproperty_srvsyntax

     
Name Scope
No Data