Re: I suppose the idea of classes and inheritance is
- From: erewhon@xxxxxxxxxx (J French)
- Date: Thu, 12 Oct 2006 07:10:22 GMT
On Wed, 11 Oct 2006 12:08:42 -0700, Jamie
<jamie_ka1lpa_not_valid_after_ka1lpa_@xxxxxxxxxxx> wrote:
Maarten Wiltink wrote:
"Jamie" <jamie_ka1lpa_not_valid_after_ka1lpa_@xxxxxxxxxxx> wrote in message
news:oavWg.110$XF2.100@xxxxxxxxxxxxxxx
[...]
X := 0;
Repeat
Inc(x);
DirectorName := UpperCase(Name[x]) in ['A'..'Z','_','0'..'9'];
Until Not DirectorName;
Wouldn't this crash (index past end of string) for names that _are_ valid?
Groetjes,
Maarten Wiltink
all strings except the short types use a Null, the Null would not pass
the test and terminate the loop check, all one would have to do is test
for the X index to determine the length of the valid portion.
While the String is 'terminated' with #0, attempting to get at that
index produces a Range Error if Range Checking is turned on.
procedure TForm1.Button1Click(Sender: TObject);
Var
S :String;
C :Char;
begin
{$R+}
S := StringOfChar('a', 10);
C := S[ Length( S ) + 1 ];
ShowMessage( IntToStr( Ord(C) ) );
end;
.
- Follow-Ups:
- References:
- I suppose the idea of classes and inheritance is
- From: Genome
- Re: I suppose the idea of classes and inheritance is
- From: Maarten Wiltink
- Re: I suppose the idea of classes and inheritance is
- From: Genome
- Re: I suppose the idea of classes and inheritance is
- From: Jamie
- Re: I suppose the idea of classes and inheritance is
- From: Maarten Wiltink
- Re: I suppose the idea of classes and inheritance is
- From: Jamie
- I suppose the idea of classes and inheritance is
- Prev by Date: Re: Question about implementing IPersist and IPersistStream
- Next by Date: Re: ActiveX
- Previous by thread: Re: I suppose the idea of classes and inheritance is
- Next by thread: Re: I suppose the idea of classes and inheritance is
- Index(es):