Path: utzoo!utgpu!watmath!clyde!att!osu-cis!dsacg1!dsacg2!nor1675 From: nor1675@dsacg2.UUCP (Michael Figg) Newsgroups: comp.sys.amiga Subject: Examine and ExNext return codes Keywords: ints, Examine Message-ID: <246@dsacg2.UUCP> Date: 29 Dec 88 13:14:46 GMT Organization: Defense Logistics Agency Systems Automation Center, Columbus, OH Lines: 53 . . In Rob Pecks' Programmer's Guide to the Amiga he says that Examine and ExNext return an int. Is this true or has it changed? The following code seems to get success set to zero, but still goes through the while loop once. There are about 30-40 files in the "src" directory so I would assume that the while loop would print all of the entries instead of just exam.c (which is in "src"). The code is like this: int success; . . lock = Lock(arg_path, ACCESS_READ); fib = (struct FileInfoBlock *) AllocMem(sizeof(struct FileInfoBlock), MEMF_CLEAR); success = Examine(lock,fib); if (success) { printf("\nFile name: %ls\n\n",&fib->fib_FileName[0]); while((success = ExNext(lock,fib)) != 0); { printf("Success equals %d\n", success); printf("File name: %s\n",&fib->fib_FileName[0]); } printf("Success equals %d\n",success); } . . Okay, I just noticed the ";" after the while statement which expains alot but just changes the scope of the question to why am I getting zero? Also in the first printf Rob uses a "%ls" which I have never seen before. In the other filename printf I use a "%s". Both seem to work. I assumed that this was an "l" as in long and not a 1 in the book. Any clues as to what is going on here? The output from this looks like this (from memory): File name: src Success equals 0 File name: exam.c Success equals 0 This was done with Lattice v5.0 and suppose now would be a good time to learn CodePRobe, right? :-) Some of the code is Robs' and some mine. Thanks. -- "Better graphics with crayons" Michael Figg Have since switched to oil based paints DLA Systems Automation Center but find they really screw up the color Columbus, Oh. map and pens! (614)-238-9036