 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
squalito
Joined: 23 Jun 2009 Posts: 10
|
Posted: Fri Jun 26, 2009 3:02 pm Post subject: Xpath() : How to set a new value with a variable name ? |
|
|
Hello;
i use a simple Xpath code in a script
I don't know how to set a variable in the xpath() like this
| Code: |
IniRead, PlaceMintPath, WamSkins.ini, Config, IPlaceMintPath
XmlSrc = %PlaceMintPath%\PlaceMint_settings.config
xpath_load(xmlfile, XmlSrc)
If (Deux = 1)
{
FileCfg=%PlaceMintPath%\PlaceMint_WindowGroups_2t.config
; Write new text
xpath(xmlfile, "/AppSettings/ConfigFileName/text()", %FileCfg%)
; save it
xpath_save(xmlfile, Xml_SRC)
}
Else If (Quatre = 1)
{
FileCfg=%PlaceMintPath%\PlaceMint_WindowGroups_4t.config
; write the new text
xpath(xmlfile, "/AppSettings/ConfigFileName/text()", %FileCfg%)
; Save it
xpath_save(xmlfile, Xml_SRC)
}
|
so how to define a varibale to set a new name ?
xpath(xmlfile, "/AppSettings/ConfigFileName/text()", %FileCfg%)
Doesn't work |
|
| Back to top |
|
 |
squalito
Joined: 23 Jun 2009 Posts: 10
|
Posted: Fri Jun 26, 2009 3:07 pm Post subject: |
|
|
pfff I'm crazy !!
of course as it is a function the % has not to be set !!
Hello;
i use a simple Xpath code in a script
I don't know how to set a variable in the xpath() like this
| Code: |
IniRead, PlaceMintPath, WamSkins.ini, Config, IPlaceMintPath
XmlSrc = %PlaceMintPath%\PlaceMint_settings.config
xpath_load(xmlfile, XmlSrc)
If (Deux = 1)
{
FileCfg=%PlaceMintPath%\PlaceMint_WindowGroups_2t.config
; Write new text
xpath(xmlfile, "/AppSettings/ConfigFileName/text()", FileCfg)
; save it
xpath_save(xmlfile, Xml_SRC)
}
Else If (Quatre = 1)
{
FileCfg=%PlaceMintPath%\PlaceMint_WindowGroups_4t.config
; write the new text
xpath(xmlfile, "/AppSettings/ConfigFileName/text()", FileCfg)
; Save it
xpath_save(xmlfile, Xml_SRC)
}
|
so
| Code: | | xpath(xmlfile, "/AppSettings/ConfigFileName/text()", FileCfg) |
works great ! |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|