home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d4xx / d430 / smartfields.lha / SmartFields / Functions / mask_range.c < prev   
Encoding:
C/C++ Source or Header  |  1991-01-11  |  595 b   |  26 lines

  1. /***************************************
  2. *  MASK ascii RANGE v1.11
  3. *  © Copyright 1988 Timm Martin
  4. *  All Rights Reserved
  5. ****************************************/
  6.  
  7. #include <exec/types.h>
  8. #include <console/fields.h>
  9. #include <console/functions.h>
  10. #include <toolkit/toolkit.h>
  11.  
  12. void mask_range( mask, low, high, set )
  13.   struct FieldMask *mask;
  14.   UBYTE  low, high;
  15.   ULONG  set;
  16. {
  17.   REG ULONG i;
  18.  
  19.   if (set)
  20.     for (i = low; i <= high; i++)
  21.       mask->Element[i>>5] |= MASK_ENABLE << (i % 32);
  22.   else
  23.     for (i = low; i <= high; i++)
  24.       mask->Element[i>>5] &= ~(MASK_ENABLE << (i % 32));
  25. }
  26.