Storing data

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • RobbyH
    Forum Member
    • Jan 2003
    • 74

    Storing data

    I have a question.
    I am using AMS to make an electronic diary.
    I am trying to figure out what the best way to store data would be.
    AMS seems to deal primarily with ini and text files. I am pretty sure there is a character limit on these types of files. When a user enters whatever they want to record about that day, I want it to be stored in a file on the users system. If I use either the text or the ini file, you could be out of storage space(within that file) very quickly. Any suggestions on how to do this?
    I need to be able to access the data, by entering the date name as well.
  • Corey
    Indigo Rose Staff Alumni
    • Aug 2002
    • 9745

    #2
    Re: Storing data

    Text files have no length limit that I know of. [img]/ubbthreads/images/icons/smile.gif[/img] Or if there is one it's certainly well beyond your needs for this project unless your "day at a glance" looks like War and Peace.

    Corey Milner
    Creative Director, Indigo Rose Software

    Comment

    • RobbyH
      Forum Member
      • Jan 2003
      • 74

      #3
      Re: Storing data

      heh
      Ok, I don't know that there is a limit for a fact.
      I just remember copying and pasting a huge amount of text once, and I was alerted that it was to big for notepad, and I had to save it in wordpad. Also, I was thinking about adding everything into one ini file, and retrieving the value when needed. I suppose I could work something out with one or more files...

      Comment

      • Corey
        Indigo Rose Staff Alumni
        • Aug 2002
        • 9745

        #4
        Re: Storing data

        Once you have your project planned out it will become apparent what limits you need to set for which portions.

        For example what is going to be the limit for each daily entry, all day timers have limits, so you need to set up some arbitrary procedures. Once you have that done the rest is a breeze. If you are archiving past days you'll need to set a limit on how many get stored, etc...

        Corey Milner
        Creative Director, Indigo Rose Software

        Comment

        • TJ_Tigger
          Indigo Rose Customer
          • Sep 2002
          • 3159

          #5
          Re: Storing data

          What about using a Global List to store entries for a diary? This might make it more secure rather than using a text file that anyone may open.
          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

          Comment

          • kpsmith
            Forum Member
            • Jul 2000
            • 332

            #6
            Re: Storing data

            The file limit message you got is stating that notepad can't handle that much text not that the .txt file format can't handle that much text. I've never heard of size limit for .txt files.

            Some other ideas you could consider is to store the data in html or XML since it is essentially a text file with specific formating or tagging.

            You would simply create a text file and save it with a .HTML or .XML extension. Either one of these could aid in data indexing and retrieval.

            Comment

            • Corey
              Indigo Rose Staff Alumni
              • Aug 2002
              • 9745

              #7
              Re: Storing data

              Global lists are no good because they are non-persistent, when you close the app all your data is toast.

              XML or HTML aren't advisable because in this context they create a few problems without offering any functionality beyond that of flat text files.

              Good ideas though guys...

              Corey Milner
              Creative Director, Indigo Rose Software

              Comment

              • RobbyH
                Forum Member
                • Jan 2003
                • 74

                #8
                Re: Storing data

                Allright, a few ideas. But I was figuring that I would have the program get the date in dd:mm:yyyy format, and that way I could use variables to save without creating anything up front. Even if I could do this, I don't know how I would have AMS create new files. I need some ideas.

                Comment

                • Corey
                  Indigo Rose Staff Alumni
                  • Aug 2002
                  • 9745

                  #9
                  Re: Storing data

                  Not sure what you mean, but anyhow it's easy to create text files using AMS using a TEX FILE > WRITE action, just check out the help files. I also reccomend to take 5 minutes to browse through all the action names, it will increase your awareness of what's possible and how to do things. They're all pretty much self explanatory at a glance for the most part, i.e. TEXT FILE > WRITE is pretty obvious, etc... Good luck!

                  Corey Milner
                  Creative Director, Indigo Rose Software

                  Comment

                  • Corey
                    Indigo Rose Staff Alumni
                    • Aug 2002
                    • 9745

                    #10
                    Re: Storing data

                    You also might want to post to our project help forum since this one seems like it might take a few questions to resolve. [img]/ubbthreads/images/icons/smile.gif[/img] Forum is here:



                    Corey Milner
                    Creative Director, Indigo Rose Software

                    Comment

                    • kpsmith
                      Forum Member
                      • Jul 2000
                      • 332

                      #11
                      Re: Storing data

                      Not knowing what you are planning to do with the Journal entries when your done or how far you want to take the project.....

                      I was thinking XML or HTML was a good idea. It would probably be what I'd do if I was building a project for a client.

                      I would probably provide a text entry field (or 2 or 3) to capture date, title, and text. Then to retrieve the entry at a later date you might want some nice formatting for printing, viewing, or repurposing. I thought HTML would be nice for this since a text file has NO formatting.

                      You could do the same sort of thing by pulling different parts of a text file into different Text objects on you page but that seems like the hard and less flexible way to do it.

                      Just depends on how sophisticated you want to get.

                      Comment

                      • Lorne
                        Indigo Rose Staff Member
                        • Feb 2001
                        • 2729

                        #12
                        Re: Storing data

                        Just a quick note: there is no limit to the size a text file can be -- except of course for any limits imposed by the file system on how large files in general can be...for example, you can't have a single file larger than 2 GB in some versions of Windows. And of course you need to have enough free space on your hard drive for the file...if you only have 5 MB of free space, then 5 MB is your practical maximum size for a text file. [img]/ubbthreads/images/icons/wink.gif[/img]

                        Notepad, however, does have a limit, of 64 KB. But that's just because Notepad sucks. [img]/ubbthreads/images/icons/smile.gif[/img]
                        --[[ Indigo Rose Software Developer ]]

                        Comment

                        • Corey
                          Indigo Rose Staff Alumni
                          • Aug 2002
                          • 9745

                          #13
                          Re: Storing data

                          KP, you don't want to include formatting with raw data. Just the facts maam as they say.

                          That way you can control/edit your formatting in just one place, the very end source. This principle applies to XML, PHP, Databases, etc...

                          Corey Milner
                          Creative Director, Indigo Rose Software

                          Comment

                          • kpsmith
                            Forum Member
                            • Jul 2000
                            • 332

                            #14
                            Re: Storing data

                            Corey, you are definately right when working with databases you should Strip the formatting and keep the data.

                            My approach was mainly because AMS4 doesn't really handle databases well without some supporting software.

                            I thought it would be so nice and easy to simply call a .html version of a journal entry to view it in a browser object.

                            Now that you got me thinking though, I would probably use a some kind of delimited text file and "database" it as you said.

                            Each line in the text file would be an individual journal entry. I would they have delimiters in that line to break out the date, title, and body of the entry.

                            You then would just call the the appropriate line in the text file and populate the appropriate fields using get delimited string actions.

                            The user could then view and edit it and on exit of that entry you'd save any changes.

                            Comment

                            • RobbyH
                              Forum Member
                              • Jan 2003
                              • 74

                              #15
                              Re: Storing data

                              Well, I came up with my own non-secure way of doing it.
                              I decided simply to incorporate the date into the whole thing, as it is a journal. The whole thing creates folders & files based on %username%. Example %SrcDir%\files\%username\%username%options.
                              It creates a file for each month, using the %month%%year%.ini for a filename. Not at all secure, but I'm just experimenting anyway. Would there be any way I could have it so that autoplay would encrypt all the files in a users folder after they logout, and decrypt(is that a word?) them when they login?

                              Comment

                              Working...
                              X