Sinisterly
[AutoIt]Another function to read XML elements - Printable Version

+- Sinisterly (https://sinister.li)
+-- Forum: Coding (https://sinister.li/Forum-Coding)
+--- Forum: Coding (https://sinister.li/Forum-Coding--71)
+--- Thread: [AutoIt]Another function to read XML elements (/Thread-AutoIt-Another-function-to-read-XML-elements)



[AutoIt]Another function to read XML elements - 1234hotmaster - 11-30-2011

include:
Code:
#include <String.au3>


Function:
Code:
Func CompReadXML($Path, $Value) ;By 1234hotma0ster Local $aRet = _StringBetween(FileRead($Path), '<' & $Value & '>', '</' & $Value & '>') If IsArray($aRet) Then Return $aRet Else Return SetError(-1) EndIf EndFunc ;==>CompReadXML


Coded by me Biggrin
The other one is a bit buggy because i didn't make it so i thought i make my own Smile


RE: [AutoIt]Another function to read XML elements - ReaperX - 12-02-2011

$Path wasn't declared in the function, how was it used? If you called this function in another function would you have to name the FileOpen() var $Path? I don't really know about user made functions.


RE: [AutoIt]Another function to read XML elements - 1234hotmaster - 12-02-2011

function parameters don't need to be declared Smile

and if you only want to read a text of a file you can use fileread directly but if you wanna read binary and stuff you need fileopen Smile


RE: [AutoIt]Another function to read XML elements - ReaperX - 12-02-2011

So if I made a function I could call variables whatever I want? And do I have to put them with the function name like you did in

Code:
CompReadXML($Path, $Value)

(12-02-2011, 10:59 PM)[ntdll.dll]x[advapi32.dll] Wrote: function parameters don't need to be declared Smile

and if you only want to read a text of a file you can use fileread directly but if you wanna read binary and stuff you need fileopen Smile

Ok. I knew that. XD



RE: [AutoIt]Another function to read XML elements - 1234hotmaster - 12-02-2011

Um... No you need to declare the ones in which you want to use to Call the function itself.


RE: [AutoIt]Another function to read XML elements - ReaperX - 12-03-2011

Ok Thanks. Everything Helped. Smile