AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Xpath() : How to set a new value with a variable name ?

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
squalito



Joined: 23 Jun 2009
Posts: 10

PostPosted: Fri Jun 26, 2009 3:02 pm    Post subject: Xpath() : How to set a new value with a variable name ? Reply with quote

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
View user's profile Send private message
squalito



Joined: 23 Jun 2009
Posts: 10

PostPosted: Fri Jun 26, 2009 3:07 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group