I'm trying to parse an XML file with QBMS (i know... not really the tool of choice) and having trouble with the numbers in the file. Luckily, the XML i'm trying to parse has only one tag per line. The tag looks something like this:
Code: Select all
<Tag id="4" idx="35" variable1="CanBeNumbersOrString" text="Lorem Ipsum">TAG_VALUE</Tag>
Let's say i want to read out the idx in a tag. So i do this:
Code: Select all
get DATA line 0
# get index
string TEMP = DATA
string TEMP 0| "idx=\""
string TEMP 0% "\""
string INDEX = TEMP
So, how do i now change the string INDEX = "35" into long INDEX = 0x23?
edit:
Actually, i tried outputting what i get to a text file to check it (with "putct INDEX string -1 MEMORY_FILE" and logging the memfile at the end) and i don't even get any output there, not even string numbers, it seems. I must be doing something wrong.
edit2:
Okay no, i don't get nothing, i actually get the byte values (it outputs 0x23) instead of 0x3533 which is ASCII for '35', outputted to text if i do the above. Despite working entirely in strings in QBMS. Now i'm completely confused