ordinal/ANSII value

Discussion in 'Software' started by iamien, Feb 19, 2003.

  1. iamien

    iamien Cptn "Eh!"

    Anyone have a table for the ordinal values of a ANSII value?
    IE
    a = 97...
    A = 65...
     
  2. joerg wontorra

    joerg wontorra Private E-2

    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
     
  3. iamien

    iamien Cptn "Eh!"

    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
     
    Last edited: Feb 20, 2003
  4. joerg wontorra

    joerg wontorra Private E-2

    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
     
  5. iamien

    iamien Cptn "Eh!"

    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 :(
     
  6. joerg wontorra

    joerg wontorra Private E-2

    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
     
  7. iamien

    iamien Cptn "Eh!"

    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)
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds