home *** CD-ROM | disk | FTP | other *** search
- /*=======================================================*/
- /* TVFSWRIT.C */
- /* */
- /* (c) Copyright 1988 Ralf Brown All Rights Reserved */
- /* May be freely copied for noncommercial use, so long */
- /* as this copyright notice remains intact, and any */
- /* changes are marked in the comment blocks preceding */
- /* functions. */
- /*=======================================================*/
-
- #include <string.h>
- #include "tvapi.h"
- #include "tvstream.h"
-
- /*=============================================*/
- /* TVfld_swrite write string to field */
- /* Ralf Brown 4/5/88 */
- /*=============================================*/
-
- int pascal TVfld_swrite(OBJECT win,int field,char *s)
- {
- char *dest ;
- int size = TVqry_fieldsize(win,field) ;
- BYTE *stream = (BYTE *)malloc(size+6) ;
-
- if (stream)
- {
- stream[0] = 0x1B ;
- stream[1] = 0x00 ;
- *((WORD *)(stream+2)) = size + 2 ;
- stream[4] = 0xF3 ;
- stream[5] = field ;
- dest = (char *)stream+6 ;
- while (*s && size--)
- *dest++ = *s++ ;
- while (size--) /* pad rest of field with blanks */
- *dest++ = ' ' ;
- TVwin_stream(win,stream) ;
- free(stream) ;
- return TRUE ;
- }
- else
- return FALSE ;
- }
-
- /* End of TVFSWRIT.C */
-