PDA

View Full Version : ordinal/ANSII value


iamien
02-19-03, 21:39
Anyone have a table for the ordinal values of a ANSII value?
IE
a = 97...
A = 65...

joerg wontorra
02-19-03, 23:29
you mean ascii, American Standard Code for Information Interchange.
ANSII doesn't exist, there's ANSI, American National Standards Institute.

ascii is a standard for text characters between 0 and 127 (including). don't get fooled by chars such as ä. it'd be the german codepage only. imagine people from greece.

therefore, go to www.unicode.org to see improvements over ascii (e.g. utf8).
if you still feel to process legacy data, go to
http://www.asciitable.com/

holsten to all of you

jeorch

iamien
02-20-03, 03:16
heeh thanks foudn the table sigh bout two hours before i checked this lol :D anyway have my program working except that if it hits a empty line in text file in crashes :(
Program is desgined to read a text file chance the ASCI values of each character. works for everything except for an empty line :( 3am i am stumpted goign to bed i'll work this tomorow
thanks for the links
And if ya know pascal maybe you can gimmy a idea of hwat to do :D

joerg wontorra
02-20-03, 09:11
probably you are using readln() or whatever it's called.
You then use writeln() to put the data back to file.
When you read an empty line, the string length of the read text is zero. Make sure you check for this.

Also, if you're changing the ascii values, make sure you skip the control characters. Newline is one of these. Depending on the platform you're on, new line can be 0x0a (unices), 0x0d0a (dos) and something really wicked on macintosh computers.
If you want to preserve the structure of the file and are reading every char one by one, take care of that.

happy coding,

joerch

iamien
02-20-03, 15:03
Thanks. i got program working for everything except an empty line
As
in
Blah
blah b lah blah
works
whereas
blah

blah blahh nrl
wont work its will output everything before the break into a file i specify but at that program gives me an error and wont run.
I'm not sure which value to tell my function to ignore, i'm talking ordinal values, according to the table 13 is newline, but that wont work :(

joerg wontorra
02-21-03, 08:31
in windows and dos, a line break is signalled by two characters:
newline (13) and carriage return (10).
in unix, there's only carriage return.

you have to ignore both.

joerch

iamien
02-21-03, 15:17
i couldnt make it work even using carrige return and new line so i simply set it up to read the thing character by character, and had it ignore those things
Works :L)