Aug. 10, 2022

Hello der,  Guest
Trader Name:
 | Home | Forum List | Active Threads | Search:
Page: of 1   
TWX Support > XOR broken?  
<< Thread >>

Joined: Jan 2007

posted: 12/14/2007 at 08:23 PM Post #1

XOR:  Does it work?  Can I buy a clue for 200, Pat?

$ssplanetmaker  # running planet maker
Script compilation error: Unknown command 'ýX', line 374 (PLANETMAKER.TS)
Script terminated: scripts\planetmaker.ts

The offending line of code is
XOR  $x 1

I wanted to flip a bit, so I checked to see if there was an available xor command.  Low and behold, there is.  But I noticed this at the bottom of the script.html reference page:

"Notes: This command is used internally by the compiler to allow conditions to work properly. Its use in conventional scripting is almost unheard of."

"grep -i -r xor scripts" reveals that none of the scripts I have downloaded have use xor.

If you are passing by this post and all you have to say is, "Why don't you write a conditional statement?" or "There are other, not as fast ways to do this," thanks for the advice, but I've already taken it.  I'm just curious if I'm using the xor command improperly.

FYI, I'm running twxproxy under wine, so that certainly could be it as well.  If I had a windows machine, I'd test it out . . .

Joined: Jul 2006

posted: 12/15/2007 at 08:11 AM Post #2

It works. you're just not usng it right:

setVar $s TRUE
setVar $s $s xor TRUE
echo "*[" & $s "]*"

this will echo:


The help file doesn't document its use properly. would be nice if other logical operators where available for use; if i remember correctly, all variable values are stored as string values by TWX --so bitwise operations are pretty much out the window.

      [ Edited to cross a 'I' and dot a 'T' ]

edited by: lonestar on 12/15/2007 at 08:24 AM

The Joker's Always Smiling in Every Hand That's De

"why hello der matey! have a sit and buy me an ale, eh?" -- The Grimy Old Trader

The Grimy Trader is best viewed at 1024x768 resolution -- this page was generated in: 0.491 seconds.