how to get out the ASC value from delphi

I want to write something like

var
s : string;

begin

s:= 'abc';

if asc(s)>30 then...{if s is space or higher...}

but its not asc, what is it?
Paer ToernellAsked:
Who is Participating?
 
2266180Connect With a Mentor Commented:
but you cannot do that on s directly as stevebay says. it would be ord(s[1]) for the first character, s[2] for the second, etc
0
 
SteveBayCommented:
Byte(s)
0
 
Paer ToernellAuthor Commented:
Not Ord(s) ?
0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
SteveBayCommented:
Both will work the same way on Char types. Ord will work on any ordinal data type.
0
 
SteveBayCommented:
Good point ciuly, I had overlooked that s was a string, not s char.
0
 
MerijnBSr. Software EngineerCommented:
don't forget to check if the string is not empty :)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.