Path: utzoo!mnetor!uunet!husc6!bloom-beacon!mit-eddie!uw-beaver!cornell!rochester!ritcv!msl5864
From: msl5864@ritcv.UUCP (Michael S. Leibow)
Newsgroups: comp.sys.amiga.tech
Subject: Re: Alerts
Message-ID: <487@ritcv.UUCP>
Date: 7 May 88 03:50:14 GMT
References: <421@hvrunix.UUCP>
Reply-To: msl5864@ritcv.UUCP (Michael S. Leibow)
Organization: Rochester Institute of Technology, Rochester, NY
Lines: 67
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
>ahinds@hvrford

The DisplayAlert() call accepts three parameters.  The first is an alert
number which describes whether the alert will reboot the machine or not.

If you want to reboot the machine use DEADEND_ALERT.  If you want to recover
after the alert (doesn't happen all of the time, only 99.9%) use
RECOVERY_ALERT.

The second paramater is the string:

	byte 1 is most significant byte of 16 bit integer.
	byte 2 is least significant byte of 16 bit integer.
		These bytes are a x coordinate for text. (0 - 640)
	byte 3 is a y coordinate.  (0 - 200 + baseline)

	bytes 4 - n
		ascii text to be displayed.  Will not wrap at the end but
		will be truncated.
	byte n+1 is a zero.
	byte n+2 is a zero if you only have one line of text.
	byte n+2 is a one if you have more text.  If you use a one in this
		spot, you must have another text record that looks exactly
		like what I just displayed.

example:  An alert that looks like the following:

+---------------------------------------------+
|     RECOVERY ALERT -- BLAH BLAH BLAH        |
|     SOME OTHER STUPID PIECE OF TEXT         |
+---------------------------------------------+

char *cp, text[40000000000000];	/* not this big, really */

cp = text;
*cp++ = '\0';		/* xpos = 10 */
*cp++ = '\10';
*cp++ = '\10';	/* ypos = 10 */
strcpy(cp, "RECOVERY ALERT -- BLAH BLAH BLAH");
for (;*cp;cp++);
*cp++ = '\1';	/* continuation character (nonzero) */
*cp++ = '\0';	/* xpos = 10 */
*cp++ = '\10';
*cp++ = '\20';	/* ypos = 20 */
strcpy(cp, "SOME OTHER STUPID PIECE OF TEXT");
	/* end of alert text */
DisplayAlert(RECOVERY_ALERT, text, 30);



-- 
Michael S. Leibow
UUCP:		{allegra,seismo}!rochester!ritcv!msl5864
CSNET:		msl5864%rit@csnet-relay.ARPA