Xref: utzoo alt.sources.amiga:231 comp.sys.amiga.programmer:3373 Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!sdd.hp.com!cs.utexas.edu!wotan!moxie!sugar!peter From: peter@sugar.hackercorp.com (Peter da Silva) Newsgroups: alt.sources.amiga,comp.sys.amiga.programmer Subject: Re: Simple Lattice C front-end for the ARP File requestor Summary: Making sample programs useful is a good thing. Message-ID: <1991May8.172401.213@sugar.hackercorp.com> Date: 8 May 91 17:24:01 GMT References: Organization: Sugar Land Unix -- Houston, TX Lines: 40 I wish I'd thought of this for my file requestor sample program: In article jkh@MEEPMEEP.PCS.COM (Jordan K. Hubbard) writes: > Seems like this might save folks some work, so here it is.. If you make the "main" look like this it'd actually be useful: ! main(ac, av) + int ac; + char **av; > { > char file[64], dir[64]; > char path[128]; > > /* Set initial contents */ > file[0] = '\0'; ! strcpy(dir, ac>2?av[2]:"SYS:"); > ! if (ArpRequestFile(0, ac>1?av[1]:"Enter file name", file, dir, path)) ! printf("%s\n", path); > else ! return 5; + return 0; > } (changed lines marked with !, new lines with +) This way you can use it as: arprequest >t:tempfile "Prompt" [initial:directory] if not warn do_something_with_tempfile endif Or even, for the courageous: arprequest >env:tempfile ... -- Peter da Silva. `-_-' .