Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...I have to add my thanks and appreciation for your wonderful site... People who frequent the site are the two best things - nice and smart..."

Geography

Where in the world do Tek-Tips members come from?
XRMICHAEL (TechnicalUser)
31 Jan 08 18:12
Hi, sorry if this seem a bit of a simply ? but i only have a need to write very basic programs.

I have to write a small programme to read a serial output from a device and represent the level data on a touch screen.

The screen can only show levels that are real/integer values.

I have stripped the relevant byte of level information with

ZONE1LEVEL:=(RECEIVEDDATA[6]);

I then try and ZONE1LEVEL:=STRINGTOINT byte 6 from above data, but ZONE1LEVEL always = 0.

With my limited knowledge stringtoint will result in 0 if the data to be converted is not something or other.

Byte 6 above will be in the range of #00 to #64

Any help greatly received.
feherke (Programmer)
1 Feb 08 5:52
Hi

The good old Pascal has no StrToInt() function. If you are using Delphi or Kylix see forum102: CodeGear (Borland): Delphi or forum755: CodeGear (Borland): Kylix. If not, tell us what flavor are you using.

Feherke.
http://rootshell.be/~feherke/

svanels (MIS)
11 Mar 08 17:45
Try the Val procedure

Val( TextVal, Number , Code) which converts String to a number.
  if this is possible the result of code = 0, other wise code indicates the character where
the error occurred

   example:

    Textval := '354';
    Val(Textval, Number, Code)  ---> Code = 0, Number = 354

   Textval := '37645x2';
   Val( Textval, Number, Code)  ---> Code = 6,  Number remains unchanged;

Steven

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close