From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,3accd44abeec75ee X-Google-Attributes: gid103376,public From: fluffy_puff@dsuper.net Subject: Re: DOS/Win95 file names Date: 1999/06/13 Message-ID: <376915b6.187530346@news.dsuper.net>#1/1 X-Deja-AN: 489207180 Content-Transfer-Encoding: 7bit References: <375fd4b4.608956077@news.dsuper.net> <3762e49c.109413162@news.dsuper.net> X-Original-NNTP-Posting-Host: asc-17-addr-153.dsuper.net Content-Type: text/plain; charset=us-ascii X-Trace: 13 Jun 1999 17:19:35 -0400, delphi.dsuper.net Organization: via Internet Direct MIME-Version: 1.0 Newsgroups: comp.lang.ada Date: 1999-06-13T00:00:00+00:00 List-Id: On Sun, 13 Jun 1999 10:45:05 GMT, jerry@jvdsys.stuyts.nl wrote: >Ok, so the problem is that the algorithm (or implementation) you >use for checking for invalid characters does not work as it is supposed >too. It is difficult to say what is wrong with it, without seeing some >actual code. > >I guess you use something like: > > with Ada.Strings.Fixed; use Ada.Strings.Fixed; > > function Has_Invalid_Char (S : String) return Boolean is > Illegal_Characters : constant String := "&?|\/:"""; > begin > for I in S'Range loop > if Index (Illegal_Characters, S(I .. I)) /= 0 then > return True; > end if; > end loop; > return False; > end Has_Invalid_Char; Exactly. At least that's what I wanted. I'll allow and even welcome you to call me stupid now. I had an external WHILE (num_periods_good AND NOT illegal_char) loop, with an EXIT (WHEN more_than_8) statement in it. Within that loop I had a simple FOR loop that was supposed to do what you just wrote, *without an exit condition, since it's a FOR loop!*. So as far as the illegal_char goes, the value I would get when coming out of this procedure was true only if one of the characters of the name was equal to the *last* character in Illegal_Characters: it would go: FALSE, FALSE, TRUE, FALSE, TRUE, ... and would simply leave the inner loop with the last one. A WHILE loop is what I have to use for the inner loop, or make a separate procedure like yours. I'm sorry for wasting your time. At least now I know I have only one problem (the accented characters, or 128-255). There's a world of difference between having two or three problems that may or may not be related, and having one single problem. Thanks for trying to help. Marc Galipeau -- What I really am is "fluffy", no "_dong", no "_puff", no "_woo", no nothing, just plain fluffy.