Can I send decimal, hex or binary data with ValueChangedCommandName? Presently, I'd like to send the following:
0xFF 0x00 [Trackbar.Value] (spaces added for clarity). In decimal form:
255 0 [Trackbar.Value] (spaces added for clarity).
TrackBar Command Editor
Hi,
You can use: [((int)num.Value).ToString("X4")] to create a message with hex values in a string.
But I think you want actual bytes. Unfortunately that doesn't seem to be working at the moment. MegunoLink is converting numbers to strings. I will try to figure out what's gone wrong and fix it.
Kind regards
Paul.
You can use: [((int)num.Value).ToString("X4")] to create a message with hex values in a string.
But I think you want actual bytes. Unfortunately that doesn't seem to be working at the moment. MegunoLink is converting numbers to strings. I will try to figure out what's gone wrong and fix it.
Kind regards
Paul.
Hello Paul,
Yes, I want the actual bytes represented by the hex and decimal values I listed.
By the way, is there available reference material describing the syntax that you provided? Looks like there is a rich set of constructs I had not known of.
Regards,
Tim
Yes, I want the actual bytes represented by the hex and decimal values I listed.
By the way, is there available reference material describing the syntax that you provided? Looks like there is a rich set of constructs I had not known of.
Regards,
Tim
Hi Tim,
The latest version (1.20.18108.0418) released today will let you get the actual bytes. In your case, you'll want something like:
The \xXX are literal byte values; converts a number to a sequence of bytes.
Expressions (surrounded by []) use a subset of the C# language so most C# expressions should work. Possibly the most useful is the ToString function, which takes a format string as an argument. Common format strings can be found here: https://docs.microsoft.com/en-us/dotnet ... at-strings
Kind regards
Paul.
The latest version (1.20.18108.0418) released today will let you get the actual bytes. In your case, you'll want something like:
Code: Select all
\xFF\x00[Tools.AsByte((byte)TrackBar.Value)]
Code: Select all
Tools.AsByte(...)
Expressions (surrounded by []) use a subset of the C# language so most C# expressions should work. Possibly the most useful is the ToString function, which takes a format string as an argument. Common format strings can be found here: https://docs.microsoft.com/en-us/dotnet ... at-strings
Kind regards
Paul.