Listing 2

switch ( wParam )
   {
   case IDM_ADD:
      /* Select a File */
      status = FileSelectDialog( hInstance, hWnd,
           Caption, FileSpec );
      if ( status == FAIL || status == FALSE )
         break;  /* Canceled the operation. */
      /* Add file to database */
      status = add_data_to_db ( FileSpec );
      break:
   case IDM_DELETE:
      /* Select a Key */
      status = KeySelectDialog ( hInstance, hWnd,
           Caption, Key );
      if ( status == FAIL || status == FALSE )
         break;  /* Canceled the operation. */
      /* Delete Keyed Data from database */
      status = del_data_from_db( Key );
      break;
   case IDM_GET:
      /* Select a Key */
      KeySelectDialog( hInstance, hWnd,
           Caption, Key );
      if ( status == FAIL || status == FALSE )
         break;   /* Canceled the operation. */
      /* Select a File */
      FileSelectDialog( hInstance, hWnd,
           Caption, FileSpec );
      if ( status == FAIL || status == FALSE)
         break;   /* Canceled the operation. */
      /* Get data from database and store in File */
      status = get_data_from_db( Key, FileSpec );
      break;
   case IDM_REPLACE:
      /* Select a Key */
      KeySelectDialog ( hInstance, hWnd,
           Caption, Key );
      if ( status == FAIL || status == FALSE )
         break;   /* Canceled the operation. */
      /* Select a data file */
      FileSelectDialog( hInstance, hWnd,
           Caption, FileSpec );
      if ( status == FAIL || status == FALSE )
         break;   /* Canceled the operation. */
      /* Replace Key data with data in FileSpec */
      status= replace_data_in_db ( Key, FileSpec );
      break;
   case IDM_VERIFY:
      /* Select a Key */
      KeySelectDialog( hInstance, hWnd,
           Caption, Key );
      if ( status == FAIL || status == FALSE )
         break;   /* Canceled the operation. */
      /* Select a File */
      FileSelectDialog( hInstance, hWnd,
           Caption, FileSpec );
      if ( status == FAIL || status == FALSE )
         break;    /* Canceled the operation. */
      /* Verify Data in database (Key) matches
      ** data in FileSpec */
      status = vrfy_data_in_db( Key, FileSpec );
      break:
   default:
      status = FAIL;
      break;
   }   /* switch (wParam) */

/* End of File */