• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1768
  • Last Modified:

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?
0
Paer Toernell
Asked:
Paer Toernell
1 Solution
 
SteveBayCommented:
Byte(s)
0
 
Paer ToernellAuthor Commented:
Not Ord(s) ?
0
 
SteveBayCommented:
Both will work the same way on Char types. Ord will work on any ordinal data type.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
2266180Commented:
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:
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

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now