two identical keys in one hashtable
Oh, no - that's not what I meant either. Sorry I thought my explanation was sufficient.
The example in the code tag should be a pure text file (* .TXT) and not a JavaScript (* .JS) file.
I will now try a detailed explanation of how I imagine this. The read files I now have are "StoryEdit.JS" and the 2nd read file "Error.TXT". The "StoryEdit.JS" is now exactly this file that I create with "F3" from within the game. The "Error.TXT" then (in this case) contains exactly the text from the code tag from my previous comment. In addition, a new file is created - I would then call this file "StoryEdit__Corrected.JS" - but only temporarily. Obviously, the read files are copied into a working folder, where the "editing" then takes place
The (Basic) program now reads the first line from "Error.TXT".
Now the (Basic) program begins to look for the line in question in "StoryEdit.JS" and at the same time writes the lines in "StoryEdit__Corrected.JS" that do not match the line from "Error.TXT".
Obviously, the (Basic) program must read approx. 10 - 40 additional lines from "
StoryEdit.JS" at the beginning and save them in a field (array), since the identifier "
_HIDDEN_UniqueID" could not always be in the same line position. Strictly speaking, when you start the (Basic) program you only have to show the first appearance of the string "
story_hashtable = new Hashtable ();" search - all previous lines can be written into the "
StoryEdit__Corrected.JS" immediately - without having to buffer the lines in the array.
From now on, the lines are read in until the next time the string "
story_hashtable = new Hashtable ();" appears and cached in the array. The first entry in the array is now the string "
story_hashtable = new Hashtable ();". Then the string "
story_hashtable [" _ HIDDEN_UniqueID "] =" Sun Feb 17 13:53:14 GMT + 0100 2019_145 ";" searched. If this character string is not found, the array is written to "
StoryEdit__Corrected.JS" without any further changes, then the content of the array is deleted, and then the next lines are read in - and written again. If the entry with the "
145" at the end is found at some point, then it goes to the 2nd part of the (Basic) program.
The next 2 or 4 lines are then read from the "
Error.TXT" file.
After the string "
story_hashtable [" MainText "] =" But i need time .. more time .. is there more you want to ask? ";" or "
story_hashtable [" NameText "] =" Maya ";" searched. If both entries are found, then these lines (in the array) are replaced with lines 3 and 5 from "
Error.TXT".
If the lines are not found (a correction could already have been made), the lines are not replaced.
Then it goes back to the 1st part of the program by writing in the "
... Corrected.JS" and reading in the next lines from "
StoryEdit.JS".
I hope it was a little more understandable now. Unfortunately, the functional description of a program is somewhat extensive.