English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

This is what I want to do:
........................
for x:= 1 to len(is_a_string) do
begin
A:= MidStr(is_a_string,x,1);
Showmessage(IntToStr(Ord(A)));
next;
end;

function TForm17.MidStr(Const Str: String; From, Size: Word): String;
begin
MidStr := Copy(Str, From, Size)
end;

..........................
but it doesn't work because that one character picked out from the string is still a "string" and not an "AnsiChar". How can I make this work?
Actually, all I want to do is go through a string and find out whether there is ANY numerical value in it, be it decimal 0...9 or ANSI Code 48...57.
I haven't quite understood whether I could use the Delphi function
Val(numberString, float, errorPos) for this purpose.
Please get me on the right path....

2007-03-23 03:47:45 · 1 answers · asked by Marianna 6 in Computers & Internet Programming & Design

1 answers

reference the string as an array, and grab the position, like this...

function StrToChr(Str: string; Pos: Integer): Char;
begin
Result := Str[Pos];
end;

2007-03-23 03:55:00 · answer #1 · answered by Got Security? 6 · 0 0

fedest.com, questions and answers