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

  1. /***************************************
  2. *  FIELD DUPlicate v1.12
  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_dup( field, wreq )
  14.   struct Field *field;
  15.   struct IOStdReq *wreq;
  16. {
  17.   int  dup_length;              /* to save length of DupBuffer */
  18.   void strcpy();                /* standard C library */
  19.   int  strlen();                /* standard C library */
  20.  
  21.   if (field->DupBuffer) {
  22.     dup_length = strlen( field->DupBuffer );
  23.     if (dup_length) {
  24.       cursor_jump_left( wreq, field->BufferPos );
  25.       con_char_mult_delete( wreq, field->NumChars );
  26.       strcpy( field->Buffer, field->DupBuffer );
  27.       field->NumChars = dup_length;
  28.       con_put_string( wreq, field->Buffer );
  29.       cursor_jump_left( wreq, field->NumChars );
  30.       field->BufferPos = 0;
  31.     }
  32.     else
  33.       FLASH_SCREEN;
  34.   }
  35.   else
  36.     FLASH_SCREEN;
  37. }
  38.