bobbie
02-14-2007, 05:30 PM
I have this from the manual :
And it works fine adding the four to the line 2 .
What I would like to do is add it to the line at the end of a paragraph .
So it would read like ....
toolbar.borderColor: White and add the White to the paragraph.
Little help with this anyone.
Thanks
-- Read the contents of a text file to a table.
text_contents = TextFile.ReadToTable("C:\\MyFile.txt");
-- Get the error code of the last action.
error = Application.GetLastError();
-- If an error occurred, display the error code message.
if (error ~= 0) then
Dialog.Message("Error", _tblErrorMessages[error], MB_OK, MB_ICONEXCLAMATION);
else
-- Remove the second item in the table (second line in the text file).
--Table.Remove(text_contents, 2);
Table.Insert(text_contents, 2, "White");
-- Write out the modified text file.
TextFile.WriteFromTable("C:\\MyFile.txt", text_contents, false);
-- Get the error code of the last action.
error = Application.GetLastError();
-- If an error occurred, display the error code message.
if (error ~= 0) then
Dialog.Message("Error", _tblErrorMessages[error], MB_OK, MB_ICONEXCLAMATION);
end
end
And it works fine adding the four to the line 2 .
What I would like to do is add it to the line at the end of a paragraph .
So it would read like ....
toolbar.borderColor: White and add the White to the paragraph.
Little help with this anyone.
Thanks
-- Read the contents of a text file to a table.
text_contents = TextFile.ReadToTable("C:\\MyFile.txt");
-- Get the error code of the last action.
error = Application.GetLastError();
-- If an error occurred, display the error code message.
if (error ~= 0) then
Dialog.Message("Error", _tblErrorMessages[error], MB_OK, MB_ICONEXCLAMATION);
else
-- Remove the second item in the table (second line in the text file).
--Table.Remove(text_contents, 2);
Table.Insert(text_contents, 2, "White");
-- Write out the modified text file.
TextFile.WriteFromTable("C:\\MyFile.txt", text_contents, false);
-- Get the error code of the last action.
error = Application.GetLastError();
-- If an error occurred, display the error code message.
if (error ~= 0) then
Dialog.Message("Error", _tblErrorMessages[error], MB_OK, MB_ICONEXCLAMATION);
end
end