Problem in Using Special Characters - Forum

Forum Navigation
You need to log in to create posts and topics.

Problem in Using Special Characters

[#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

@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

emileu has reacted to this post.
emileu

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 .

@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.

 

Vadim and emileu have reacted to this post.
Vadimemileu