wiki:Docs/Prog/Manual/ApplicationLibraries/lib825ev/Form/IN_EVENT_WRITE_DATA

Version 2 (modified by Don Wilson, 6 years ago) ( diff )

--

IN_EVENT_WRITE_DATA

Standard form behavior is that if the form is exited by escape or left arrow any changes are lost. It is often useful to prompt the user in this instance whether to keep any changes. The IN_EVENT_WRITE_DATA macro when used in a form done event will write the changed data.

IN_EVENT_WRITE_DATA

Parameters

  • None

Return Value

This function does not return any value

Remarks

IN_EVENT_WRITE_DATA is a macro to the call to form WriteData within a form event. The preprocessor will replace this with a call to the WriteData function of the form.

#define IN_EVENT_WRITE_DATA pForm->WriteData()

Examples

EVENT(InputDone) 
{
   if(nData == FORM_DONE_ESCAPE || nData == FORM_DONE_LEFT_ARROW)
   {
      if (pForm->IsChanged() == true)
      {
         if(WaitPrompt(LANG(STR_SAVE_CHANGES), LANG(STR_YES), LANG(STR_NO)) == true)
         {
            IN_EVENT_WRITE_DATA;
         }
      }
   }
   return 1;
}

See Also

Note: See TracWiki for help on using the wiki.