Keyboard Shortcuts
ctrl + shift + ? :
Show all keyboard shortcuts
ctrl + g :
Navigate to a group
ctrl + shift + f :
Find
ctrl + / :
Quick actions
esc to dismiss
Likes
Search
invalid escape sequence
hi im new to simple + and I need a little help. I have this code that compiles with no problems but when I put it in a simple windows programme and compile the programme I get 4 warning's that say invalid escape sequence on the 4 strings to be inserted into the makestring. thanks in advance for any help.
/* Compiler Directives (Uncomment and declare compiler directives as needed) */ // #ENABLE_DYNAMIC // #SYMBOL_NAME "" // #HINT "" // #DEFINE_CONSTANT // #CATEGORY "" // #PRINT_TO_TRACE // #DIGITAL_EXPAND // #ANALOG_SERIAL_EXPAND // #OUTPUT_SHIFT // #HELP_PDF_FILE "" #DEFAULT_VOLATILE #ENABLE_STACK_CHECKING #ENABLE_TRACE #ENCODING_ASCII // #ENCODING_UTF16 // #ENCODING_INHERIT_FROM_PARENT // #ENCODING_INHERIT_FROM_PROGRAM /* DIGITAL, ANALOG and SERIAL INPUTS and OUTPUTS (Uncomment and declare inputs and outputs as needed) */ DIGITAL_INPUT Palette1, Palette2, Palette3, Palette4, Palette5; STRING_INPUT RedLevel[20], GreenLevel[20], BlueLevel[20]; // STRING_INPUT Palette; // BUFFER_INPUT // DIGITAL_OUTPUT // ANALOG_OUTPUT RedFB, GreenFB, BlueFB; STRING_OUTPUT ColourTX$; INTEGER Pal[20]; //Palette String Number PUSH Palette1 { MAKESTRING (Pal, "00"); } PUSH Palette2 { MAKESTRING (Pal, "03"); } PUSH Palette3 { MAKESTRING (Pal, "06"); } PUSH Palette4 { MAKESTRING (Pal, "09"); } PUSH Palette5 { MAKESTRING (Pal, "0c"); } //Send String On Level Change Change RedLevel, GreenLevel, BlueLevel { makestring (ColourTX$,"\x00\x00\x04\x00\xA5\x00\x5A\x00\x09\x00\x21\x00\x72\x75\x6e\x2f\x65\x65\x67\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\%02x\x00\x00\x00\x03\x00\%s\%s\%s\x01\x00\x01\x00\x00" ,(Pal[20]),(RedLevel),(GreenLevel),(BlueLevel)); } |
What is the format of your string? It is probably an hex value between 00
and FF. You need to add x in the front of your string or change your \%s by \x%s in your makestring command. Le samedi 17 aot 2013, aaronjmartin1986 a crit : ** -- Envoy� avec Ipad Gmail Mobile // Sent with Ipad Gmail Mobile [Non-text portions of this message have been removed] |
If your values are bytes, store them in INTEGERs and then format them with
makestring(..., "%c", value) On Sat, Aug 17, 2013 at 6:44 AM, aaronjmartin1986 < aaron.j.martin1986@...> wrote: hi im new to simple + and I need a little help. I have this code that -- Jeremy Weatherford |
Chip
You need to include the x for the \ escape notation
toggle quoted message
Show quoted text
The strings you're trying to incorporate with those escape sequences MUST be 2 characters long, and you have them defined as 20 characters - you could trim that down to 2 You have Pal declared as an integer, when I believe you meant it to be a string? If so, you need change how you have it passed in MAKESTRING (%02x would work if it were really an integer) and remove the [20] at the end of your MAKESTRING statement. If you meant it to be an integer, you have it declared as an array of 20 integers, which would make the MAKESTRING statements you have in those PUSH handlers fail. - Chip --- In Crestron@..., "aaronjmartin1986" <aaron.j.martin1986@...> wrote:
|
to navigate to use esc to dismiss