piclist 2001\01\02\052904a >
Thread: pascal string handling
www.piclist.com/techref/index.htm?key=pascal+string+handling
flavicon
face BY : Roger Frederick Chin email (remove spam text)



Ok my Pascal's quite rusty so I don't remember the syntax for doing this
but I can give you a general idea and hope your friend knows how to
implement this.

you can treat the string as a character array to
access each letter depending on the platform you're running on you may
need to change the data type, but a long should be at least 16 bits

so you'll grab the last letter in the string, typecast to a long, shift
it left 8 bits, then typecast the 2nd to the last byte to a byte (from a
char) and add it to the long.

---
var data:string;
       answer:longint;
answer := (longint(data[12]) SHL 8) + (byte(data[11]));
--

if this is wrong its because i've been doing c so long i've forgotten my
pascal :)

hope it helps


Roger Chin

>
Date: Tue, 2 Jan 2001 04:54:12 -0500 > From: Graham <TakeThisOuTGraham.DTakeThisOuTspamRemoveMEWANADOO.FR>
{Quote hidden}

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


<Pine.SOL.3.91.1010102050216.16449H-100000@teer8.acpub.duke.edu>

In reply to: <3a51a53a3a5dcdd9@villosa.wanadoo.fr> (added by villosa.wanadoo.fr)
See also: www.piclist.com/techref/index.htm?key=pascal+string+handling
Reply You must be a member of the piclist mailing list (not only a www.piclist.com member) to post to the piclist. This form requires JavaScript and a browser/email client that can handle form mailto: posts.
Subject (change) pascal string handling

month overview.

new search...