Path: utzoo!attcan!uunet!samsung!emory!mephisto!psuvax1!rutgers!umn-d-ub!cs.umn.edu!thelake!steve From: steve@thelake.mn.org (Steve Yelvington) Newsgroups: comp.sys.atari.st Subject: Re: DA's and Curses Summary: What's that egg doing on my face? Here's a correction. Keywords: DA, desk accessory, Sozobon Message-ID: Date: 12 Apr 90 14:19:36 GMT References: <2225@ariel.unm.edu> <16567@eagle.wesleyan.edu> Lines: 71 In <16567@eagle.wesleyan.edu>, ncastellano@eagle.wesleyan.edu writes: >In article , > steve@thelake.mn.org (Steve Yelvington) writes: >> char path[128], defult[13] = '\0'; > >My version of Sozobon C would not compile this unless I changed 'char' to >'static char'. This agrees with what I know about string initialization in C, >which is that you can only initialize char strings if they are extern or >static. Right. I slopped the code together in a hurry and posted it (a year ago!) without testing it. And sure enough, it was hosed up. Arggh! I hate it when that happens. It's pretty hard to make an excuse when you repost a year-old mistake. At least this time somebody actually tried to compile it. :-) >Even after getting it to compile, the desk accessory didn't seem to do >anything; it merely exited to the desktop. Any idea what I might be doing >wrong? I ld'd the libraries in the order suggested (dastart.o, accskel.o, >aesfast.a, vdifast.a, dlibs.a) Any help would be appreciated. You didn't do anything wrong. I typed in a couple of things from bad documentation -- the description of AES messages on page 516 of "Atari ST Application Programming" by Pollack and Weber. The lesson here is twofold: One, don't post untested code, and two, NEVER believe any documentation about the ST* until you have checked it out three ways. (* Same could be said for anything read on Usenet.) AC_OPEN is 40, not 30. And the DA's apid should be found in msgbuf[4], not msgbuf[3]. Corrected code follows. #define MENU_ID " File selector " #define AC_OPEN 40 #ifndef GEMFAST int contrl[12], intin[128], intout[128], ptsin[128], ptsout[128]; #endif main() { int apid, menuid, msgbuf[8]; apid = appl_init(); /* say hello to the AES */ menuid = menu_register(apid, MENU_ID); /* add me to the Desk menu */ while (1) /* loop forever */ { evnt_mesag(msgbuf); if ( (msgbuf[0] == AC_OPEN) && (msgbuf[4] == menuid) ) wakeup(); } appl_exit(); /* you'll never get here -- supposedly */ } wakeup() /* Whatever needs to be done. Here we display the fsel ... */ { char path[128], defult[13]; defult[0] = '\0'; int button; fullpath(path,"*.*"); fsel_input(path,defult,&button); } -- Steve Yelvington at the lake in Minnesota steve@thelake.mn.org