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 

Please help resolving xpath error.

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






PostPosted: Wed Jul 30, 2008 6:52 am    Post subject: Please help resolving xpath error. Reply with quote

Here is the code i m using.

Code:

#include xpath.ahk
xml =
(
<?xml version="1.0" encoding="UTF-8"?>
<Default>
<detector maxRotationRadius="37.1" gradedAbsOpacity="0.298" actualAngularTicks="4" detectorThickness="2.54" systemType="2.0" axialDetectSizeCM="40" detectorOpacity="0.58" transDetectSize="54"
/>
</Default>
)
xpath_load(xml)
MsgBox % "maxRotationRadius=" . xpath(xml, "/Default/detector/@maxRotationRadius/text()")
    . "`ngradedAbsOpacity=" . xpath(xml, "detector/@gradedAbsOpacity/text()")
    . "`nactualAngularTicks=" . xpath(xml, "detector/@actualAngularTicks/text()")

But when i run the script i am getting NumPut function error pointing to the xpath.ahk

Please help resolving this error.
Back to top
Krogdor



Joined: 18 Apr 2008
Posts: 1145
Location: The Interwebs

PostPosted: Wed Jul 30, 2008 7:08 am    Post subject: Reply with quote

I believe that XPath_Load() expects a file, not a string? I might be wrong about this.
Back to top
View user's profile Send private message AIM Address
engunneer



Joined: 30 Aug 2005
Posts: 6847
Location: Pacific Northwest, US

PostPosted: Wed Jul 30, 2008 7:38 am    Post subject: Reply with quote

Is the error saying tha NumPut is an invalid function? If so, you need to update your version of AHK, which will add this function for you.

In the future, please post your question to the topic that you got the script from. I wouldn't be surprised if someone else has had the same problem and posted there.
_________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM
Back to top
View user's profile Send private message Visit poster's website
Hasso



Joined: 23 Mar 2005
Posts: 158
Location: Germany

PostPosted: Tue Aug 26, 2008 10:14 am    Post subject: Reply with quote

I got a similar error and added a space between xpath_load ( and the opening bracket - then it was accepted!
_________________
Hasso

Programmers don't die, they GOSUB without RETURN
Back to top
View user's profile Send private message
Krogdor



Joined: 18 Apr 2008
Posts: 1145
Location: The Interwebs

PostPosted: Tue Aug 26, 2008 7:35 pm    Post subject: Reply with quote

Hasso wrote:
I got a similar error and added a space between xpath_load ( and the opening bracket - then it was accepted!


If you do it like that, XPath_Load is no longer regarded as a function, but as a variable. For example:
Code:

Var := XPath_Load(xml)

assigns the return from XPath_Load(xml) to the variable "Var".
Code:
Var := XPath_Load (xml)

assigns the variable "XPath_Load" followed by the variable "xml". The former is probably blank, and so Var will most likely become equal to "xml".
_________________
PlayAHK! Try it out Very Happy
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   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