Quote from Gaev on May 19, 2023, 3:50 am@smartmedia
Last night, while working on v3 of the App, I ran into these issues ...
1) I found out that the Wait command does NOT work inside a subroutine; so, instead of being able to invoke the function like this ...
smFileToVariables "https://servicefinder.gr/en.txt" [loadHere] 500 "$$" "="... you will need to settle for this ...
FileToVar "https://servicefinder.gr/en.txt" [loadHere] Wait 500 smExtractVariables [loadHere] "$$" "=" EndWait2) Your test file has invalid characters; I have highlited the lines ...
Headline1=In first part will be the object name and on second part will be the text$$
Headline2=I dont know if the equal sign (=) is the appropriate symbol to use as separator between elements$$
Paragraph1=I think its better to use the special character at the end of line$$
TextInput1=A possible special character could be the $$ dollar sign or a special character that is not used in HTML tags$$... placing the = sign or $$ within the values of the variables messes up the logic (remember, any delimiters you choose can NOT be part of the variable values; please remove them.
After removing the ineligible characters in en.txt, perhaps you can setup test lines ...
en2.txt - using == and zzz as delimiters
en3.txt - using => and ;; as delimiters
Last night, while working on v3 of the App, I ran into these issues ...
1) I found out that the Wait command does NOT work inside a subroutine; so, instead of being able to invoke the function like this ...
smFileToVariables "https://servicefinder.gr/en.txt" [loadHere] 500 "$$" "="
... you will need to settle for this ...
FileToVar "https://servicefinder.gr/en.txt" [loadHere] Wait 500 smExtractVariables [loadHere] "$$" "=" EndWait
2) Your test file has invalid characters; I have highlited the lines ...
Headline1=In first part will be the object name and on second part will be the text$$
Headline2=I dont know if the equal sign (=) is the appropriate symbol to use as separator between elements$$
Paragraph1=I think its better to use the special character at the end of line$$
TextInput1=A possible special character could be the $$ dollar sign or a special character that is not used in HTML tags$$
... placing the = sign or $$ within the values of the variables messes up the logic (remember, any delimiters you choose can NOT be part of the variable values; please remove them.
After removing the ineligible characters in en.txt, perhaps you can setup test lines ...
en2.txt - using == and zzz as delimiters
en3.txt - using => and ;; as delimiters

Quote from smartmedia on May 19, 2023, 3:30 pmHi..
@gaev
i have update the files
Hi..
i have update the files
Quote from Gaev on May 19, 2023, 3:38 pm@smartmedia
i have update the files
Thanks.
Sorry about the issue I found only after I tried to place everything inside a single subroutine; so it won't be the command solution you were looking for.
I hope to deliver v3 tonight/tomorrow.
Thanks to the sample uploaded by @emmanuel-fernandez , I got some ideas on improving the subroutine called smExtractVariables (coding it in javascript instead of neoscript might make it a cleaner solution, and still provide the ability to specify delimiters).
i have update the files
Thanks.
Sorry about the issue I found only after I tried to place everything inside a single subroutine; so it won't be the command solution you were looking for.
I hope to deliver v3 tonight/tomorrow.
Thanks to the sample uploaded by @emmanuel-fernandez , I got some ideas on improving the subroutine called smExtractVariables (coding it in javascript instead of neoscript might make it a cleaner solution, and still provide the ability to specify delimiters).

Quote from emo on May 19, 2023, 4:19 pmI appreciate that in the end you realized that the solution was there ;-), mentioning me is to be appreciated, a greeting @gaev
I appreciate that in the end you realized that the solution was there ;-), mentioning me is to be appreciated, a greeting @gaev
Quote from Gaev on May 20, 2023, 2:47 pm@smartmedia
I have attached v3 of the example App for your review and response.
The older page and its subroutines are still in there; only the first page (labelled v3) and the one subroutine the button code invokes (smExtractVariables) are relevant.
There are four buttons ...
- the first three will upload the 3 different files you setup on your server; this verifies that the specification of different delimiter strings works.
- the fourth button (labelled Style) is to show the impact of having style elements included as part of the variable values; the content uploaded from the 3 files does not appear to have any style content, so I set up the relevant variables with style tags to verify that SetObjectHTML works as expected.
BTW, I ended up coding the smExtractVariables subroutine using neoscript after all, as I could not see any documentation pertaining to passing of parameter values to subroutines coded with javascript. For future reference, if anyone knows how to access content of passed variables in Javascript Subroutines, please post the link to the Help file or a Sample App.
I have attached v3 of the example App for your review and response.
The older page and its subroutines are still in there; only the first page (labelled v3) and the one subroutine the button code invokes (smExtractVariables) are relevant.
There are four buttons ...
- the first three will upload the 3 different files you setup on your server; this verifies that the specification of different delimiter strings works.
- the fourth button (labelled Style) is to show the impact of having style elements included as part of the variable values; the content uploaded from the 3 files does not appear to have any style content, so I set up the relevant variables with style tags to verify that SetObjectHTML works as expected.
BTW, I ended up coding the smExtractVariables subroutine using neoscript after all, as I could not see any documentation pertaining to passing of parameter values to subroutines coded with javascript. For future reference, if anyone knows how to access content of passed variables in Javascript Subroutines, please post the link to the Help file or a Sample App.
Uploaded files:
Quote from emo on May 21, 2023, 12:53 am@gaev , this is another alternative to loading languages from a text file. You can load both normal variables and html objects. If they are normal variables, it automatically creates them with the same name they have in the language file, and if the language file specifies that it is html, it treats it as an html object (simply adding to the end of the html variable eg:paragraph1html= ). The example loads en.txt and es.txt. To check, add these files where you compile the release and launch the neophp server and go to localhost.
@gaev , this is another alternative to loading languages from a text file. You can load both normal variables and html objects. If they are normal variables, it automatically creates them with the same name they have in the language file, and if the language file specifies that it is html, it treats it as an html object (simply adding to the end of the html variable eg:paragraph1html= ). The example loads en.txt and es.txt. To check, add these files where you compile the release and launch the neophp server and go to localhost.
Uploaded files:Quote from Gaev on May 21, 2023, 2:08 am@emmanuel-fernandez
I think your post should be directed to @smartmedia as I was merely responding to his specific request; my suggestion was never meant to be a universal solution without restrictions.
BTW, as per my last post, I ended up scripting the subroutine with neoscript because I could not find any documentation on passing parameters to a javascript subroutine; do you have anything on how this is done, or is it not possible at all ?
Finally, after loading v3 of the sample app, I made a couple of improvements; so I will be uploading the improved version by Monday. One of the improvements was that there was a neoscript command to obtain the size of an array after all (did not have to revert to javascript to obtain this information).
I think your post should be directed to @smartmedia as I was merely responding to his specific request; my suggestion was never meant to be a universal solution without restrictions.
BTW, as per my last post, I ended up scripting the subroutine with neoscript because I could not find any documentation on passing parameters to a javascript subroutine; do you have anything on how this is done, or is it not possible at all ?
Finally, after loading v3 of the sample app, I made a couple of improvements; so I will be uploading the improved version by Monday. One of the improvements was that there was a neoscript command to obtain the size of an array after all (did not have to revert to javascript to obtain this information).

Quote from smartmedia on May 21, 2023, 9:56 amHi..
First of all i like toy thank you all for your time and effort to help me working this out.
I came up with a simple solution that i think will do the work. I created a demo if someone wants to use it..
Again your contribution was very helpful.
Hi..
First of all i like toy thank you all for your time and effort to help me working this out.
I came up with a simple solution that i think will do the work. I created a demo if someone wants to use it..
Again your contribution was very helpful.
Uploaded files:
Quote from smartmedia on May 22, 2023, 10:04 amUpdate.
The latest update i have to offer they has to do on functionality.
I finally replaced = sign with | sign as separation symbol. I also will break the translation file into every page file, is more handy and bypass the problem of loosing changes on moving into different pages. The subroutine goes like this.
FileToVar "[NAB.PageID]-[Language].txt" [TranslationText] neoSetItem "SelectedLanguage" [Language] "" Wait 500 StrParse "[TranslationText]" "\r\n" [myVariableItems] ArrayLen [myVariableItems] [arraylength] Loop 0 [arraylength] [LoopPos] SetVar [thisLineText] [myVariableItems([LoopPos])] StrParse "[thisLineText]" "|" [thisLinePart] SetObjectHTML "[thisLinePart(0)]" "[thisLinePart(1)]" EndLoopI use the id page and language as filename so everything are more robust. The variable [Language] has value (en) or (gr) or can have what ever you want. I also use Local storage to keep track the user preferred language and i invoke it on page start up like this.
RenderLang "en"
Because i use menu on site, i have added a menu and i invoke the sub like this
neoTopMenuAddDropdownItem "[container]" "language" "<img src='img/en.png' style='max-width: 26px; max-height: 26px;'></img> English" "neo.RenderLang('en')"
You need to add a string parameter on sub RenderLang with the variable [Language] in order to pass the en or gr or what ever you want on subroutine.
I hope it could be useful to anyone wants to add multi language support on he's site, and is very easy.
PS> The only problem i have now are the alertboxes but i will figure it out i suppose.
Update.
The latest update i have to offer they has to do on functionality.
I finally replaced = sign with | sign as separation symbol. I also will break the translation file into every page file, is more handy and bypass the problem of loosing changes on moving into different pages. The subroutine goes like this.
FileToVar "[NAB.PageID]-[Language].txt" [TranslationText] neoSetItem "SelectedLanguage" [Language] "" Wait 500 StrParse "[TranslationText]" "\r\n" [myVariableItems] ArrayLen [myVariableItems] [arraylength] Loop 0 [arraylength] [LoopPos] SetVar [thisLineText] [myVariableItems([LoopPos])] StrParse "[thisLineText]" "|" [thisLinePart] SetObjectHTML "[thisLinePart(0)]" "[thisLinePart(1)]" EndLoop
I use the id page and language as filename so everything are more robust. The variable [Language] has value (en) or (gr) or can have what ever you want. I also use Local storage to keep track the user preferred language and i invoke it on page start up like this.
RenderLang "en"
Because i use menu on site, i have added a menu and i invoke the sub like this
neoTopMenuAddDropdownItem "[container]" "language" "<img src='img/en.png' style='max-width: 26px; max-height: 26px;'></img> English" "neo.RenderLang('en')"
You need to add a string parameter on sub RenderLang with the variable [Language] in order to pass the en or gr or what ever you want on subroutine.
I hope it could be useful to anyone wants to add multi language support on he's site, and is very easy.
PS> The only problem i have now are the alertboxes but i will figure it out i suppose.