home *** CD-ROM | disk | FTP | other *** search
/ Fish 'n' More 2 / fishmore-publicdomainlibraryvol.ii1991xetec.iso / disks / disk430.lzh / SmartFields / Functions / field_tab_forward.c < prev    next >
C/C++ Source or Header  |  1991-01-11  |  978b  |  39 lines

  1. /***************************************
  2. *  FIELD TAB FORWARD v1.11
  3. *  © Copyright 1988 Timm Martin
  4. *  All Rights Reserved
  5. ****************************************/
  6.  
  7. #include <exec/io.h>
  8. #include <exec/types.h>
  9. #include <console/console.h>
  10. #include <console/fields.h>
  11. #include <console/functions.h>
  12.  
  13. void field_tab_forward( field, wreq )
  14.   struct Field *field;
  15.   struct IOStdReq *wreq;
  16. {
  17.   int jump;  /* jump size */
  18.  
  19.   if ((field->BufferPos + 2 < field->MaxChars) &&
  20.       (field->BufferPos < field->NumChars)) {
  21.     if (field->NumChars + 1 == field->MaxChars) {
  22.       if (field->BufferPos + TAB_JUMP < field->NumChars)
  23.         jump = TAB_JUMP;
  24.       else
  25.         jump = field->NumChars - field->BufferPos - 1;
  26.     }
  27.     else {
  28.       if (field->BufferPos + TAB_JUMP <= field->NumChars)
  29.         jump = TAB_JUMP;
  30.       else
  31.         jump = field->NumChars - field->BufferPos;
  32.     }
  33.     cursor_jump_right( wreq, jump );
  34.     field->BufferPos += jump;
  35.   }
  36.   else
  37.     FLASH_SCREEN;
  38. }
  39.