Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

save string to text file

Status
Not open for further replies.

chedderslam

Programmer
Jun 16, 2008
24
US
I am trying to save the contents of a control to a text(.xml) file.

I have tried the following:
string s_file_name, s_quote_response

s_file_name = 'C:\quote1.xml'

s_quote_response = tab_data.tabpage_result.mle_1.text

s_quote_response.saveas(s_file_name,"","")

I have also tried this:
string s_file_name, s_quote_response

s_file_name = 'C:\quote1.xml'

tab_data.tabpage_result.mle_1.saveasascii(s_file_name,"","")

Please help.
 
Saveas and Saveasascii are used in Datawindows, datastores, graphs, or OLE controls not 'standard' controls like multilineedits.

You will need to use FileOpen, FileWrite, and FileClose functions to do what you are trying to do.

Matt

"Nature forges everything on the anvil of time
 
String ls_filename, ls_filedata
Long ll_file

// set variable values
ls_filename = sle_filename.Text
ls_filedata = mle_data.Text

// open the file for write
ll_file = FileOpen( ls_filename, TextMode!, Write!, LockReadWrite!, Replace! )

// write to the file
FileWriteEx( ll_file, ls_filedata )

// close the file
FileClose( ll_file )
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top