Quote from emileu on August 3, 2023, 8:42 pm[#124] not work in messegebox or read from txt file
i want read from txt file and use as variable and data of file contain | symbol . but it turn to line break . i try [#124] but it didnt work and still turn to line break -
the [#124] looks not working
so is this a bug ? or if it is any tips to solve problem let me know
[#124] not work in messegebox or read from txt file
i want read from txt file and use as variable and data of file contain | symbol . but it turn to line break . i try [#124] but it didnt work and still turn to line break -
the [#124] looks not working
so is this a bug ? or if it is any tips to solve problem let me know
Quote from Gaev on August 4, 2023, 12:54 am@emileu
so is this a bug ? or if it is any tips to solve problem let me know
This is NOT a bug; both,
MessageBox (https://winhelp.visualneo.com/MessagesInteraction.html#MESSAGEBOX)
and
FileWrite (https://winhelp.visualneo.com/Files1.html#FILEWRITE)
... commands use the pipe character ("|") for a special purpose.
Workaround solutions generally involve the use of another separator character strings e.g. ";;" or "$$$", which can then be converted back to the pipe character using the StrReplace command.
If you need details, please post ...
a) a few lines from your text file that you are attempting to FileRead (is this file created using FileWrite command or another program like notepad.exe ?)
b) the FileRead command used to read lines from this file
c) the subsequent MessageBox command that you are attempting with the lines read from the text file
so is this a bug ? or if it is any tips to solve problem let me know
This is NOT a bug; both,
MessageBox (https://winhelp.visualneo.com/MessagesInteraction.html#MESSAGEBOX)
and
FileWrite (https://winhelp.visualneo.com/Files1.html#FILEWRITE)
... commands use the pipe character ("|") for a special purpose.
Workaround solutions generally involve the use of another separator character strings e.g. ";;" or "$$$", which can then be converted back to the pipe character using the StrReplace command.
If you need details, please post ...
a) a few lines from your text file that you are attempting to FileRead (is this file created using FileWrite command or another program like notepad.exe ?)
b) the FileRead command used to read lines from this file
c) the subsequent MessageBox command that you are attempting with the lines read from the text file
Quote from emileu on August 4, 2023, 11:08 amfor detail . i want read from txt file that contain data like this
"1hiepr5|WLjE1kIY8OYRIN456576j"
so when this data read to variable then i want to use in some cmd commands and need to be read this line exatly as it is
but its turn to 2 line and cant use that kind variable
i just have problem in reading from file and writing in the file is ok with "!" character
and about messegebox . just tell me how show "|" character in messeges
tnk u for help .
for detail . i want read from txt file that contain data like this
"1hiepr5|WLjE1kIY8OYRIN456576j"
so when this data read to variable then i want to use in some cmd commands and need to be read this line exatly as it is
but its turn to 2 line and cant use that kind variable
i just have problem in reading from file and writing in the file is ok with "!" character
and about messegebox . just tell me how show "|" character in messeges
tnk u for help .
Quote from Gaev on August 4, 2023, 4:50 pm@emileu
Thank you for the detailed response.
i want read from txt file that contain data like this
"1hiepr5|WLjE1kIY8OYRIN456576j"i just have problem in reading from file and writing in the file is ok with "!" character
This works ...
FileRead "[PubDir]TextWithPipe.txt" "All" "[gkText]"... note that AlertBox will treat the pipe characters as new line, but when I setup a TextBox with the variable [gkText], it displays as a single line with the pipe characters intact.
and about messegebox . just tell me how show "|" character in messeges
Unfortunately, just like AlertBox, MessageBox treats all pipe characters as a new line.
If you have to show the entire line (using your example of "1hiepr5|WLjE1kIY8OYRIN456576j"), then the only workaround I can suggest is as mentioned in my earlier post i.e. ...
a) use StrReplace to temporarily replace the pipe characters with another (unique) character string like ";;;;;" or "$$$$" or "====>" as the separator string ... you can design your pub to use any one of several replacement strings (if the first one is not unique, then use the second one etc.)
b) after the user has made a selection, StrReplace again to reverse the change.
Thank you for the detailed response.
i want read from txt file that contain data like this
"1hiepr5|WLjE1kIY8OYRIN456576j"i just have problem in reading from file and writing in the file is ok with "!" character
This works ...
FileRead "[PubDir]TextWithPipe.txt" "All" "[gkText]"
... note that AlertBox will treat the pipe characters as new line, but when I setup a TextBox with the variable [gkText], it displays as a single line with the pipe characters intact.
and about messegebox . just tell me how show "|" character in messeges
Unfortunately, just like AlertBox, MessageBox treats all pipe characters as a new line.
If you have to show the entire line (using your example of "1hiepr5|WLjE1kIY8OYRIN456576j"), then the only workaround I can suggest is as mentioned in my earlier post i.e. ...
a) use StrReplace to temporarily replace the pipe characters with another (unique) character string like ";;;;;" or "$$$$" or "====>" as the separator string ... you can design your pub to use any one of several replacement strings (if the first one is not unique, then use the second one etc.)
b) after the user has made a selection, StrReplace again to reverse the change.