Skip to content

Instantly share code, notes, and snippets.

@amclain
Created February 9, 2015 07:58
Show Gist options
  • Save amclain/8e2a11f47ea0e02cd850 to your computer and use it in GitHub Desktop.
Save amclain/8e2a11f47ea0e02cd850 to your computer and use it in GitHub Desktop.
(***********************************************************
Binary OR Bug
************************************************************)
PROGRAM_NAME = 'bor bug'
(***********************************************************)
(* System Type : NetLinx *)
(***********************************************************)
(* DEVICE NUMBER DEFINITIONS GO BELOW *)
(***********************************************************)
DEFINE_DEVICE
dvRPC = 34500:1:0;
(***********************************************************)
(* CONSTANT DEFINITIONS GO BELOW *)
(***********************************************************)
DEFINE_CONSTANT
(***********************************************************)
(* VARIABLE DEFINITIONS GO BELOW *)
(***********************************************************)
DEFINE_VARIABLE
(***********************************************************)
(* THE EVENTS GO BELOW *)
(***********************************************************)
DEFINE_EVENT
data_event[dvRPC]
{
string:
{
char char40;
integer int20;
integer int40;
char40 = $40;
int20 = $20;
int40 = $40;
send_string 0, "'$20 | $40: ', itoa($20 | $40)"; // => 96 ($60) - RIGHT
send_string 0, "'$20 | int40: ', itoa($20 | int40)"; // => 32 - WRONG
send_string 0, "'int20 | $40: ', itoa(int20 | $40)"; // => 96 ($60) - RIGHT
send_string 0, "'int20 | int40: ', itoa(int20 | int40)"; // => 96 ($60) - RIGHT
send_string 0, '-'
send_string 0, "'$0020 | int40: ', itoa($0020 | int40)"; // => 32 - WRONG
send_string 0, "'type_cast($20) | int40: ', itoa(type_cast($20) | int40)"; // => 96 ($60) - RIGHT
send_string 0, "'$20 | char40: ', itoa($20 | char40)"; // => 32 - WRONG
send_string 0, '-'
send_string 0, "'$20 | int40: ', itoa($20 | int40)"; // => 32 ($20) - WRONG
send_string 0, "'type_cast($20) | int40: ', itoa(type_cast($20) | int40)"; // => 96 ($60)
}
}
(***********************************************************)
(* END OF PROGRAM *)
(* DO NOT PUT ANY CODE BELOW THIS COMMENT *)
(***********************************************************)
#end_if
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment