Search Locate Previous Next Contents

New-Open-Save-Exit (NOSE)


Description
Offers Windows-standard behaviour on File-Open etc. To use this object, you will need to set the current file name as data, the filebox prompt as specification, and then field a number of events in the Behaviour table.

The actions will be called automatically, depending on the results from previous actions, and the state of the system, for example whether a file of the same name is already on disk. The NOSE events you should handle are:

   ASK - ¾„ is the data dirty
  GET - YourReadFunction ¾
  PUT - YourWrite Function ¾
  ZAP - YourClearFunction

ASK is optional – if you do not record the fact that the user has modified some data since the last ‘GET’, a good safety feature would be to include ¾„1 here so that the application always prompts ‘Do you want to save?’ on exit.

Typically you will invoke the NOSE from your File menu, for example:

&Open: nose ’Do 'Open'

A good place for the ‘Exit’ call is on the Close Request on your main form as it returns zero if the user cancels ...

CR: 0=nose ’Do 'Exit : ’Reject : : 

Class Property Table
NameTypeDefaultDescription
File nameUserCurrent File Name
SpecificationRuntimeFile Prompt (‘*.ext’ ‘Application name’ )

Class-specific Events
ASKAm I dirty?
PUTSave this File!
GETOpen this File!
ZAPClear this Workspace!

Class-specific Functions
ExitHandles all that needs to happen on File/Exit
SaveHandles all that needs to happen on File/Save
SaveAsHandles all that needs to happen on File/SaveAs
NewHandles all that needs to happen on File/New
OpenHandles all that needs to happen on File/Open
SetNewNameSets name for next new file
FileExistsCheck if file is already there
SetDirectorySet search directory for File,Open
SetSaveMsgReplace the default ‘save file?’ prompt
SetReplMsgReplace the default ‘overwrite?’ warning


Continue to: New-Open-Save-Exit – ASK Event
© Copyright Causeway Graphical Systems Ltd 2003