Indigo Rose Software

Professional Software Development Tools

 
+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Join Date
    Jun 2008
    Posts
    165

    Problem that needs solving - please help!!

    I am making an address book in AMS and I am stuck, have tried the examples Ive found, but not managed to sort it right.

    I have a combo box listing various statuses (ie Mr, mrs etc) and then seperate input boxes for the rest of the information, this is then saved to a text file and it appears like this:

    Mr Donnald Duck
    45 Duckpond Lake
    Riverside
    Riverborough
    AB1 2CD
    01234567890
    01234567890
    email.address.here@here.com
    When this is saved, it saves the file with the first & last name ie Donnald Duck.file BUT the problem I am having is then loading this file back and putting the different lines back in the boxes, as I want a view / edit sort of thing so I guess I need to know how to read each seperate line from the file and then intert it in the right boxes?

    If I just do a textfille.readtostring, it all displays right in a paragraph, so i know the file is loading right, but how to seperate the lines?

    Please help as I am going to share this with the AMS community when its completed to say thankyou for all the help Ive recieved!

  2. #2
    Join Date
    Apr 2005
    Location
    São Paulo, Brazil
    Posts
    2,539
    Why don't you read the file back using TextFile.ReadToTable()? You could then access easily each line and work with the data you retrieved.

    Ulrich

  3. #3
    Join Date
    Jun 2008
    Posts
    165
    Thanks for your fast reply Ulrich, I think I have done that?!?!
    Here is what I have so far:
    [CODE]blTextFile = TextFile.ReadToTable("AutoPlay\\AdbDta\\"..FileNam e..".adb");

    for n=1, Table.Count(tblTextFile) do
    tblLine = DelimitedStringToTable(tblTextFile[n], ",")
    if Table.Count(tblLine) == 4 then
    ComboBox.SetText("ComboBox1", tblLine[1]);
    Input.SetText("Address1", tblLine[2]);[
    end
    end /CODE]

    Im getting myself into a right muddle with the code! :(

  4. #4
    Join Date
    May 2003
    Location
    Pendleton, Oregon
    Posts
    1,038
    Give this a try
    Attached Files
    Add-ons for AMS. Toolbar Buttons Galore, System Animations, the Window Construction Kit, and more.
    Visit Acme-Tek

  5. #5
    Join Date
    Jun 2008
    Posts
    165
    Thank you Ulrich & JimS for your help, and here as promised is the app I built, please feel free to change it in anyway you wish, if nothing else, it can be used as a base for others!

    One problem I did find however, when I added a new person, it didnt show up in the list, so I wanted to do a trick I did on another project, whereby putting a file.runsameprogram.exe and then application.exit which worked perfectly on my other app, is this a bug in dialog.ex??

    Anyway, here it is and I hope you all have fun with it

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts