Solved

how to get out the ASC value from delphi

Posted on 2008-06-13
6
1,676 Views
Last Modified: 2013-11-23
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
Comment
Question by:Sunsales
6 Comments
 
LVL 14

Expert Comment

by:SteveBay
ID: 21780982
Byte(s)
0
 

Author Comment

by:Sunsales
ID: 21781149
Not Ord(s) ?
0
 
LVL 14

Expert Comment

by:SteveBay
ID: 21781217
Both will work the same way on Char types. Ord will work on any ordinal data type.
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 28

Accepted Solution

by:
ciuly earned 500 total points
ID: 21781367
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
 
LVL 14

Expert Comment

by:SteveBay
ID: 21781579
Good point ciuly, I had overlooked that s was a string, not s char.
0
 
LVL 19

Expert Comment

by:MerijnB
ID: 21781808
don't forget to check if the string is not empty :)
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

In our object-oriented world the class is a minimal unit, a brick for constructing our applications. It is an abstraction and we know well how to use it. In well-designed software we are not usually interested in knowing how objects look in memory. …
How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org (http://seleniumhq.org) Go to that link and select download selenium in the right hand columnThat will then direct you to their downlo…
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now