Magic User Group

Magic Wiki-Wakka : UseBackslashInINI

HomePage :: CATEGORIES | Index :: Changes :: Comments :: Search :: Login/Register
How to put \ with iniput in .magic.ini file?

Version: Generic - this has worked with magic for quite some time (v5?)

By default, the "\" is the "escape" character which indicates that the next character has some special meaning.

The "proper" way of including a "\" is to escape it with another "\".

INIPUT ('[MAGIC_LOGICAL_NAMES]PATH=D:\\Temp\\2005\\')

However, this is REALLY tedious and somewhat prone to error. Magic has provided a much easier method, which is to use an asterisk "*" in the value. This instructs magic to NOT interpret the "\" as an escape character.

INIPUT ('[MAGIC_LOGICAL_NAMES]PATH=*D:\Temp\2005\')

As a point of interest and for the sake of truly understanding this use of the *, it should be noted that the * can go anywhere in the value. Any "\" characters BEFORE the * will be treated as an escape character (and therefor removed from the value), while any "\" AFTER the * will NOT be treated as an escape character (and will remain in the value).

Back to: TuTorials
Categories
CategoryHowTo

There are no comments on this page. [Add comment]

Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by Wikka Wakka Wiki trunk
Page was generated in 0.0433 seconds