Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 11 of 11
  1. #1
    Join Date
    Mar 2006
    Posts
    20

    How to save data from text fields and checkboxes to a file?

    Id like to theese things:

    1:
    Have multiple input fields which by default has different values and can be changed and save to a text file.
    i.e. if it exists a file.txt in my docs folder, which already has for example Name myname, age myage, and so on in it, to then have a three input fields, one for name and one for age. When something is entered into it and the save button is pressed it overwrites the current values in the file.txt.

    2:
    Have a reated feature but instead of an input field, have a dropdown box with preset values, i.e. for age, like beeing able to select groups of 10-20, 20-30, 30-40 and so on, and then saving that value to the same file.txt

    3:
    Having a dropdown box which lists all existing files of a certian type within a folder. i.e. that you can select between all .txt files in e.g. docs\textfiles and then edit them or having their values loaded into some input field or related. Mainly having the feature of listing the files and then allowing their content to be shown.

  2. #2
    Join Date
    Oct 2004
    Location
    East, South & West Asia
    Posts
    1,020
    hi,

    Take a look at some samples in this site. You might find something useful for your purpose.
    Newbie Examples
    ------> AMS 7.5 : amstudio.azman.info
    ----> AMS 6 & 5: www.azman.info/ams/
    ----> FB: facebook.com/GuideToWealth

    ----> Content Development Blog: www.AZMAN.asia

  3. #3
    Join Date
    Mar 2006
    Posts
    20
    Yeah, I know, working with it, almost gotten the first one finished, How can I tell it to print the following variables to a new line?

    e.g.
    Text2BeSaved="Headline "..1stparagraph.." "..2ndparagraph.."";

    Thereby having it saved like
    Headline
    1stparagraph
    2ndparagraph

    Just as simple as \n and such,, but how?

  4. #4
    Join Date
    Sep 2002
    Location
    Sol 3
    Posts
    3,160
    Quote Originally Posted by D0M1N0R View Post
    Just as simple as \n and such,, but how?
    With windows you will wnat to use a \r\n.

    Text2BeSaved="Headline \r\n"..1stparagraph.."\r\n "..2ndparagraph.."";

    Tigg
    TJ-Tigger
    "A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
    "Draco dormiens nunquam titillandus."
    Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine

  5. #5
    Join Date
    Mar 2006
    Posts
    20
    Ok, thanks, was just trying out that, but it wouldnt accept "\r\n", but just \r\n works fine

  6. #6
    Join Date
    Sep 2002
    Location
    Sol 3
    Posts
    3,160
    Quote Originally Posted by D0M1N0R View Post
    Ok, thanks, was just trying out that, but it wouldnt accept "\r\n", but just \r\n works fine
    You need to make sure that the \r\n is contained within a string.

    GOOD
    Text2BeSaved="Headline \r\n"..1stparagraph.."\r\n "..2ndparagraph.."";

    BAD
    Text2BeSaved="Headline "\r\n..1stparagraph..\r\n" "..2ndparagraph.."";
    Tigg
    TJ-Tigger
    "A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
    "Draco dormiens nunquam titillandus."
    Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine

  7. #7
    Join Date
    Mar 2006
    Posts
    20
    Yep.

    Ive got the first and second points working, anyone got a clue on this?
    Having a dropdown box which lists all existing files of a certian type within a folder. i.e. that you can select between all .txt files in e.g. docs\textfiles and then edit them or having their values loaded into some input field or related. Mainly having the feature of listing the files and then allowing their content to be shown.

  8. #8
    Join Date
    Sep 2002
    Location
    Sol 3
    Posts
    3,160
    Having a dropdown box which lists all existing files of a certian type within a folder. i.e. that you can select between all .txt files in e.g. docs\textfiles and then edit them or having their values loaded into some input field or related. Mainly having the feature of listing the files and then allowing their content to be shown.
    Certainly. Use the File.Find command to find all the .txt files in the directory you want to use. This will return a table which you can parse using a for loop to step through each item and add them to a ComboBox. As you step through the table I would use String.SplitPath to break the file drive/path/filename/extension into its separate parts and then add the filename as the text item to the combobox and the full path as the data. That way when you want to open the file you can use the data portion of the combobox to open the file.

    HTH
    Tigg
    TJ-Tigger
    "A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
    "Draco dormiens nunquam titillandus."
    Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine

  9. #9
    Join Date
    Sep 2002
    Location
    Sol 3
    Posts
    3,160
    BTW azmanar's site has a lot of good examples showing how to do this kind of stuff too.

    Tigg
    TJ-Tigger
    "A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
    "Draco dormiens nunquam titillandus."
    Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine

  10. #10
    Join Date
    Oct 2005
    Posts
    572

    Good Luck From Lnd The File In Attach

    Good Luck From Lnd The File In Attach
    Attached Files
    Last edited by lnd; 10-02-2006 at 11:55 AM.

  11. #11
    Join Date
    Mar 2006
    Posts
    20
    Lots of thanks

Posting Permissions

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