Intermec 5055 Guida Di Riferimento

Pagina di 216
im_get_screen_char
5-34
im_get_screen_char
Purpose:
This function returns the character at the current cursor position in the 80 x 25 display.
Syntax:
#include "im5055.h"
IM_STATUS im_get_screen_char
    (IM_UCHAR far 
*char
);
IN Parameters:
None.
OUT Parameters:
char    Pointer to the variable for the retrieved character.
Return Value:
IM_SUCCESS    Success.
Notes:
This function returns only the character. Use im_get_text to retrieve the character and
its attributes.
See Also:
im_get_text, im_putchar, im_puts
Example
/********************* im_get_screen_char ****************************/
#include " im5055.h "
IM_UCHAR   value;
void main()
{
   int x = 1;         /* Row Value */
   int y = 10;        /* Column Value */
   im_clear_screen(); /* Clear display screen */
    /* Display letters and numbers to chose from */
   im_cputs("ABCDEFGHIJKLMNOPQRST\n", IM_NORMAL);
   printf("UVWXYZ-0123456789\n");
   /* Chose character by setting Row and Col values */
   im_set_cursor_xy(x,y);
   /* Retrieve character at position specified */
   im_get_screen_char(&value);
   /* State which character was chosen */
   im_set_cursor_xy(3,0);
   printf("The character chosen:\n");
   printf("is:  %1c",value);
   /* Wait for user input before exiting */
   im_set_cursor_xy(14,0);
   im_puts("Press any key to", IM_NORMAL);
   im_puts("exit.", IM_NORMAL);
/* Move cursor to character chosen */
   im_set_cursor_xy(x,y);
   getch();
}