Re: I suppose the idea of classes and inheritance is



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.


--
Real Programmers Do things like this.
http://webpages.charter.net/jamie_5

.



Relevant Pages

  • Re: I suppose the idea of classes and inheritance is
    ... Wouldn't this crash (index past end of string) for names that _are_ valid? ... Maarten Wiltink ...
    (alt.comp.lang.borland-delphi)
  • Re: Insert characters after comas
    ... Maarten Wiltink wrote: ... <adding four spaces after each comma> ... function Transform(const Text: String): String; ... with the loop index), but really, how _can_ you make it harder ...
    (alt.comp.lang.borland-delphi)
  • Re: Using TWriter with strings
    ... Maarten Wiltink wrote: ... <Str1 is a constant, AStr a local variable> ... string in the file) but the second call to Writer.Write with the ...
    (comp.lang.pascal.delphi.misc)
  • Re: Identify a variable type
    ... "Maarten Wiltink" wrote in message ... > You can easily write your own IsNumeric function (and in fact I've ... >> but this throws an error if it is a string. ... > Pascal is a strongly typed language. ...
    (comp.lang.pascal.delphi.misc)
  • Re: Invalid variant type conversion
    ... >> string value. ... pointers, not strings. ... a concept from type theory and formal specification methods, ... Maarten Wiltink ...
    (comp.lang.pascal.delphi.misc)