R
Rob W
Greetings,
A carry on from my previous post regarding writing a simple text editor. I
have implemented a "Save as" option where a save dialog appears on
conditions:-
* "Save as" option is selected from the file menu
* Saving a document on inital openning of the editor or new file option
(default document name is "document")
My solution for the second criteria checks if the document name is the
default name i.e. "document" andAlso the document has been modified using
the textbox modified property andAlso a boolen variable called initalWrite
is true (Upon form load initalWrite is set to true).
Then during the "save as" operation the boolen variable initialWrite is set
to false.
Another idea was for when the editor is started or a new file is created
store the current date/time in a variable and compare the modified timestamp
of the default document "document" to check if it has been saved within the
session. This solution appears over complicated compared to using a boolean.
As this is for an assignment the code and design will be scruitinised and as
I hope to use these reports to show employees I want to ensure my logic is
sound and always looking for the most cleanest simplest solution to solve a
problem.
Hope I don't sound too pedantic but its for the reasons above I want to
ensure I do my best.
Any input to my current solution using the boolean variable? This works as
required btw.
Thanks
Rob
A carry on from my previous post regarding writing a simple text editor. I
have implemented a "Save as" option where a save dialog appears on
conditions:-
* "Save as" option is selected from the file menu
* Saving a document on inital openning of the editor or new file option
(default document name is "document")
My solution for the second criteria checks if the document name is the
default name i.e. "document" andAlso the document has been modified using
the textbox modified property andAlso a boolen variable called initalWrite
is true (Upon form load initalWrite is set to true).
Then during the "save as" operation the boolen variable initialWrite is set
to false.
Another idea was for when the editor is started or a new file is created
store the current date/time in a variable and compare the modified timestamp
of the default document "document" to check if it has been saved within the
session. This solution appears over complicated compared to using a boolean.
As this is for an assignment the code and design will be scruitinised and as
I hope to use these reports to show employees I want to ensure my logic is
sound and always looking for the most cleanest simplest solution to solve a
problem.
Hope I don't sound too pedantic but its for the reasons above I want to
ensure I do my best.
Any input to my current solution using the boolean variable? This works as
required btw.
Thanks
Rob