Suppose I have a *.txt file, in which I want to alter a value in a special line. This *.txt file may look as follows:
line 1: any entry . . . . line n: [sectionname] line n+1: value . . .
Of course, the terms line 1, line 2, ... does not really appear in the *.txt, but only in the editor. My question is now, how can I change the value in line n+1? Has anyone an idea?
Can you paste the actual file? Or a snip of it? That may help. ConfigWrite can handle writing anything in the form of ENTRYNAMEVALUE as long as the ENTRYNAME is unique in beginnings of line in the whole file.
Sometimes, the impossible can become possible, if you're awesome!
Exactly this seems to be the problem, that this unique ENTRYNAME is missing. Accordingly "Configwrite" not seem to be applicable. It's the file "conf.txt", which is included in the app PeaZip. Here is the relevant snap:
Especially I'm interested on the two lines, which are marked strong.
One option in that case is doing a replace and storing the last value as we do with SumatraPDF Portable. So it would start with the platform's language and then switch with it. Unless the user changes it themselves in the app, in which case it would cease automatically changing unless it synced up again.
The other option is custom code and reading in the file until you get to [language] and an end line and then reading in until the next end line. Then doing a replace in the file from that value to the new one. That wouldn't need to worry about syncing. And there is code that does something similar in a custom non-PAL launcher somewhere. I can't recall where offhand, though.
Sometimes, the impossible can become possible, if you're awesome!
Meanwhile I've thought about some possible solutions.
Firstly I have pasted in the folder DefaultData\settings the file conf.txt with the following content:
Then I have pasted in the file PeaZipPortable.ini the following lines of code:
But this solution doesn't work. Alternatively I have pasted in the file PeaZipPortable.ini the following lines of code:
But once again this solution doesn't work
A few weeks ago I've released a solution to the language problem in PeaZip in another post. All seemed to work fine. But now I have detected the following problem. Suppose I have changed the language after the run of the app in the PA.com menu. Now I closed the app. If I now start the app and I want change the language in the default language of the PA.c menu, then that default language doesn't appears about the menu Options -> Localization. The reason for that problem is, that due to the code in the hook ${SegmentPrePrimary} now the default language appears as "default.txt" and not as "de-uml.txt" in my special case.
But how can I solve this problem?