JohnB 255 Posted August 30, 2010 Report Share Posted August 30, 2010 Before I ask the question, I just want to say I already know the HARD way to do this. I want to see if there is an easier way. Let's say I have two lists. One has the names of ten text files (each text file contains a paragraph of text). The second list has the ten titles of those files in the exact same order. The customer wants to be able to just have a random file chosen. So having said that, is there an easier way then setting ten variables for each list to match the choice (list item) from list two to list one. In other words, if text file in list position 3 is randomly chosen from list one, how can I ensure that list position 3 is also chosen from list two? Thanks. John Quote Link to post Share on other sites
Seth Turin 223 Posted August 30, 2010 Report Share Posted August 30, 2010 a couple things come to mind: is there a reason why you're using lists instead of tables? then you could just select a row with all the information. to answer your question, if I understood it correctly, I would just set a variable to a random number and use that variable with $list item to reference the same item number in each list. Quote Link to post Share on other sites
JohnB 255 Posted August 30, 2010 Author Report Share Posted August 30, 2010 That's why you're the genius and I'm not! Thanks Seth. The reason I am not using tables is really just a matter of convenient scripting. He wants to load text files and I on't feel like doing all the sorting tonight. I will probably (now that you've mentioned it) do it as an upgrade for him sometime in the near future. Just a bit lazy this week! http://ubotstudio.com/forum/public/style_emoticons/default/rolleyes.gif Quote Link to post Share on other sites
pftg4 102 Posted August 30, 2010 Report Share Posted August 30, 2010 (edited) hi john i'll take a shot here is it as easy as johnb.ubot Pftg4 Damm you seth beat me to it Edited August 30, 2010 by pftg4 1 Quote Link to post Share on other sites
JohnB 255 Posted August 30, 2010 Author Report Share Posted August 30, 2010 Thank you both. That is exactly what I meant! Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.