• Reading from file

    From Merlin@CARSO to All on Tuesday, September 03, 2002 23:44:00
    I've written a program and am reading data from a file using the
    fread_line command.

    ~the data in the file line by line goes like

    1
    3
    4
    Merlin
    CarSo Bs
    2
    3
    4
    Pamela
    Beverley, UK
    3
    4
    5
    Name
    Location

    etc, each user record is 5 lines. I can read the lines in okay with fread_line, but I need to convert the numbers from character strings to integers.
    Is there a command to convert a string to an integer or
    is there an easier way to do it?

    Merlin ---------------------------------------------------------------------------
    Merlin - Sysop of CarSo BBs - telnet://carso.darktech.org ---------------------------------------------------------------------------


    ---
    ■ Synchronet ■ CarSo BBs ■ Beverley, UK ■ telnet://carso.darktech.org
  • From Digital Man to Merlin on Tuesday, September 03, 2002 15:08:28
    Re: Reading from file
    By: Merlin to All on Tue Sep 03 2002 11:44 pm

    I've written a program and am reading data from a file using the
    fread_line command.

    ~the data in the file line by line goes like

    1
    3
    4
    Merlin
    CarSo Bs
    2
    3
    4
    Pamela
    Beverley, UK
    3
    4
    5
    Name
    Location

    etc, each user record is 5 lines. I can read the lines in okay with fread_li but I need to convert the numbers from character strings to integers.
    Is there a command to convert a string to an integer or
    is there an easier way to do it?

    Just use the COPY function, it will convert from str to int (or vice versa) automatically.

    digital man