I asked --
1) Is this fairly simple to write this word-of-the-day tool in pure javascript?
The answer was
1) yes
Review -- the answer was an answer, but (politely) it was not very polite or useful. So, for the "helpful" people out there, I'll restate...
1) Can you provide simple sample code or a discussion of the commands required to show me how fairly simple it is to write this word-of-the-day tool in pure javascript, since my hours of research online resulted in NO EXAMPLES of reading a file on a website and processing it?
My second question was --
2) Is it also fairly simple to create random lists of a enterred list count from the file mentioned above... to create a "Word-of-the-day" list for a newsletter... either a weekly or monthly newsletter?
The answer was --
2) er, I didn’t understand what you mean.
Review -- the answer was an answer to a question that was asked as completely as I could, given that I have only been coding seriously in JavaScript for little more than a week.
My question came as an extension of the previous question.
While I was writing the second question, I was thinking as a designer wanting to extend the idea (or modify it slightly).
Again, I am still working through the solution.
Yet, let me (the person trying to ask for help) explain, a little more... having no clue about file handling in JavaScript, but having a general idea about what I'm wanting to do. Since I don't know JavaScript, I'll have to present the idea in a pseudo-code type of presentation... hoping that someone can look it over with JavaScript in mind, and help me figure out the best way to implement it... again I'll state, since I'm not that knowledgeable of Javascript development yet.
If I wanted to look at the file from the first discussion, and pull a certain number of unique words (to be defined before the function is called by a form field)...
- Function ReadXWords (num_required)
-
{
-
// I need a variable to count the words that I've read.
-
-
For loop_val = 1 to num_required
-
Array [ loop_var ] = (random() * 29766) + 1
-
-
// call a function or method to sort the values in the array
-
// into ascending order
-
-
// open the web wordfile
-
// handle the exit if the wordfile does not exist
-
-
( only if it's required to set the end-of-file condition on empty-file before the while)
-
// read a line from the file
-
-
// if I had to read before the while loop, then use the following logic
-
-- loop2_var = 1
-
// if I did not have to read before the while loop, then use the following logic
-
-- loop2_var = 0
-
-
array_index = 1
-
-
// while (not (eof on wordfile)) and (array_index <= num_required)
-
-
// // if loop2_var == Array [ array_index ]
-
// // // store word read from file into found_word_array [ array_index ]
-
// // // increment array_index by 1
-
// // end /* if loop2_var == Array [ array_index ] */
-
// // increment loop2_var by 1
-
// // read a line from the file
-
-
// end the while loop
-
-
// * At this point, found_word_array has the num_required elements
-
// * and has pulled random words from the file.
Hopefully, I described well enough what I'm trying to do in general terms, and I can get some tips and suggestions about things to consider...
--- use a hash...
--- don't use a hash...
--- yes it is simple... look at this thread and/or this code.
--- yes it is difficult in JavaScript, but look at this thread and/or this code.
--- you might want to read about {topic} at {web address}
Thank you in advance for helping me with this strings from a file project.
Peace.