Thank you, safetycar, for your interest.
After some further test and recherches I think that my original questions and examples were not correct and useful. (Typical of a newbie...). I do here a new attempt with a new approach.
In the initial part of scripts an information text about the purpose and use of the program is often inserted. The following is a special example:
Code: Select all
; =============================
; MyCrazyApp.ahk
; =============================
; USAGE & NOTES & HELP:
; This ...
; Please note that the following characters and strings:
; `r`n (LF)
; ` (accent grave / backtick)
; ; (semicolon)
; & (ampersand)
; must be ...
; =============================
My idea was: It would be practical if the same text could be used at the same time as help text for the user (quasi in double function). The goal would be that the same text should be visible in the script as well as e.g. in a MsgBox
as identical plain text.
My first attempt to implement this concept was to use a
multiline text variable:
Code: Select all
; =============================
; MyCrazyApp.ahk
; =============================
Help =
(
=============================
MyCrazyApp.ahk
=============================
USAGE & NOTES & HELP:
This ...
Please note that the following characters and strings:
`r`n (LF)
` (accent grave / backtick)
; (semicolon)
& (ampersand)
must be ...
=============================
)
; ...
Gui, Add, Button, x50 y40 w100 ggHelp, Help
Gui, Show, w200 h100
RETURN
; ...
gHelp: ; "Plain text to plain text" – HOW TO DO THIS???
Help := RegExReplace(Help, "`r`n", "``r``n") ; This works for `r`n
;Help := RegExReplace(Help, ... ; ??? for `
MsgBox % Help
Return
In the above example `r`n can be replaced to receive the same plain text in the MsgBox. Could it really be that there is no solution to implement this concept for `?
But there would also be another question immediately: Is there a solution for % included in the multiline text variable???
If all this fails, is there another method (instead of the multiline text variable) to implement this concept???