Path: utzoo!mnetor!uunet!cbmvax!schein From: schein@cbmvax.UUCP (Dan Schein CATS) Newsgroups: comp.sys.amiga.tech Subject: Re: Alerts Message-ID: <3739@cbmvax.UUCP> Date: 6 May 88 12:57:58 GMT References: <421@hvrunix.UUCP> Reply-To: schein@cbmvax.UUCP (Dan Schein CATS) Organization: Commodore Technology, West Chester, PA Lines: 79 Keywords: what exactly is the Alert String definition In article <421@hvrunix.UUCP> ahinds@hvrunix.UUCP (Alexander Hinds) writes: > > I'm writing a program and I need to use alerts. However, the >Intuition manual isn't too clear on the String structure definition. >What I really don't understand is if I want more than one string to >appear in my alert, do I link the various structures together via the >last field? (I can't remember what's it suppossed to be called right >now.) The Intuition manual says that this field is a byte long, but that's >not long enough for a pointer. Are they assuming that the byte is really >an integer and is assumed to be 32bits long? Any help would be appreciated. >I thank you in advance. > >Alexander Hinds Heres an OLD example I threw together, its not pretty - but it works :-) /* Create a RECOVERY_ALERT */ /* 09-29-87 Dan Schein */ #include extern APTR OpenLibrary(); extern VOID CloseLibrary(); APTR IntuitionBase; char String[] = {0x00,0x18,0x18,'y','o','u',0,1, 0x00,0x40,0x20,'b','u','m',0,0}; void main(); void main() { int i; int Height = 50; long AlertNumber = 00010000; IntuitionBase = OpenLibrary("intuition.library",33); /* open library and check for a specific version of OS */ /* 0 = Any version 30 = 1.0 or higher 31 = 1.1 NTSC or higher 32 = 1.1 PAL or higher 33 = 1.2 or higher */ if (IntuitionBase != 0) /* if open succeeded */ { i = DisplayAlert(AlertNumber,String,Height); /* open alert window & check which button is pressed */ if (i != 0) /* user pressed left button */ { printf("You pressed the left button!\n"); } else /* user pressed right button */ { printf("You pressed the right button!\n"); } } else { printf("Update to V1.2!\n"); /* OS version failure message */ } CloseLibrary(IntuitionBase); /* exit gracefully */ } -- Dan "Sneakers" Schein uucp: {ihnp4|allegra|burdvax|rutgers}!cbmvax!schein Commodore AMIGA ARPANET: cbmvax!schein@uunet.uu.net 1200 Wilson Drive Bix: dschein Plink: Dan*CATS West Chester PA 19380 phone: (215) 431-9100 ext. 9542 +----------------------------------------------------------------------------+ Call BERKS AMIGA BBS - 24 Hrs - 3/12/2400 Baud - 40Meg - 215/678-7691 +----------------------------------------------------------------------------+ I help Commodore by supporting the AMIGA. Commodore supports me by allowing me to form my own suggestions and comments.