LISTING 4 TestSR.c Program for Testing the StringsRequest Function /*********************************************************** * * * TestSR.c -- (C) Copyright 1988, by Randy Finch * * * * Program to test StringsRequest function * * * * This program was compiled with Lattice C v4.01 * * and linked with StrReq.o using BLINK * * * * Run from CLI * * * ***********************************************************/ #include #include extern BOOL StringsRequest(); struct IntuitionBase *IntuitionBase; struct NewWindow newwin = { 0,0,640,200, /* LeftEdge, TopEdge, Width, Height */ 0,1, /* DetailPen, BlockPen */ MENUPICK | CLOSEWINDOW | /* IDCMPFlags */ GADGETUP | GADGETDOWN | REQCLEAR, WINDOWSIZING | WINDOWDRAG | WINDOWCLOSE | ACTIVATE | SMART_REFRESH, /* Flags */ NULL, /* FirstGadget */ NULL, /* CheckMark */ "Test Window", /* Title */ NULL, /* Screen */ NULL, /* BitMap */ 20,20, /* MinWidth, MinHeight */ 640,200, /* MaxWidth, MaxHeight */ WBENCHSCREEN }; /* Type */ UBYTE HText[80]; /* Header Text */ UBYTE NumEnt; /* Number of string gadgets */ WORD BoxWid[10]; /* Array of gadget widths */ UBYTE titles[10][80]; /* Array of gadget titles (10 strings, 80 characters max) */ UBYTE deftext[10][80]; /* Array of default text for gadgets */ WORD maxlen[10]; /* Array of maximum default text string lengths (80 max) */ WORD typedt[10]; /* Array of gadget types (0 - regular, 1 - long integer) */ LONG temp; /* Temporary variable */ STRPTR Titles[10]; /* Array of pointers to title strings */ STRPTR Deftext[10]; /* Array of pointers to default text strings */ void main() { struct Window *win; UBYTE i; BOOL rt; /* Get information about requester */ printf("Header: "); scanf("%s",HText); printf("Number of Entries: "); scanf("%d",&temp); NumEnt = (UBYTE)temp; for(i=0; i