SpookMeister Posted February 8, 2007 Share Posted February 8, 2007 Hey guys, I'm looking for input on a program design issue I am facing. I want to create a program that, in the course of its functions, pulls random words from a list of around 10k words. This program will be run by multiple users from a network share, perhaps at the same time, so file locking issues may come into play. Currently I have the list of words in a simple .txt file, one per line. I'm toying with other options here and want some more experienced opinions on how best to avoid file locking and other multi-user issues. - Should I try to stick them into a database instead of the flat file? - Should I have the program read the file into a huge array? - - or perhaps just hard code the words into the program as they are going to be static information anyway? - Should I just leave them in the flat file and develop some sort of way to incorporate error handling around the brief file locking issues? Any thoughts? -Spook [u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote] Link to comment Share on other sites More sharing options...
ChrisL Posted February 8, 2007 Share Posted February 8, 2007 Personally I think a Database would be the way forward, there are some SQLite UDF's in the examples forum [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
/dev/null Posted February 8, 2007 Share Posted February 8, 2007 (edited) This program will be run by multiple users from a network share, perhaps at the same time, so file locking issues may come into play.why do you think, file locking comes into play? I don't think that AutoIT does a lock on a file when it reads it! So, no problem....A database is a bit overkill, if you just need a flat list of words.... Edited February 8, 2007 by /dev/null __________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf * Link to comment Share on other sites More sharing options...
Moderators big_daddy Posted February 8, 2007 Moderators Share Posted February 8, 2007 I use something similar to this in my Hangman Game (see my signature). Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now