MADRIX Forum • Web Safe SetTickerText
Page 1 of 1

Web Safe SetTickerText

Posted: Tue Mar 03, 2015 11:29 am
by poya
Hi Guys,

I've almost finished my project and the last stumbling block I'm having is sending web safe strings for the ticker text to display.

Using setTickerText HTTP command, the '#' or %23 equivalent is being dropped from the string. so the message 'Welcome to #HelloWorld testing' becomes 'Welcome to' when sent via the setTickerText HTTP command. Is there a way for me to ensure all characters sent are correctly interpreted by Madrix?

Thanks in advance for your help so far, been a huge help.

Poya

Re: Web Safe SetTickerText

Posted: Tue Mar 03, 2015 6:14 pm
by Guertler
Hello poya,
.
At the moment the MADRIX HTTP server can not interpret the # or %23 and also discards all letters which are behind this sign.
What you can do is: Change # to another string of signs like +++ before the application sends the string to the MADRIX.
In MADRIX you have to create a "Layer Macro" which replace the ++++ to a #.
.
Maybe the following macro code snip is helpful:

Code: Select all

string txt;

void InitEffect()
{
	

}

void PreRenderEffect()
{
	txt = GetText();
	replace(txt, "++++", "#");
	SetText(txt);
}

Re: Web Safe SetTickerText

Posted: Wed Mar 04, 2015 6:40 pm
by poya
Hey Guertler,

Thanks for that suggestion. I've implemented it into my ticker text using the snippet you provided.

I was just wondering if there are any other major characters I should provide a fall back for; a list of any you know if would be great.

Thanks again.

Poya

Re: Web Safe SetTickerText

Posted: Thu Mar 05, 2015 5:38 pm
by Guertler
Helo poya,
.
At the moment you can not send the # (%23) and ? (%3F) via HTTP to the "SCE Ticker/Scrolling Text".

Re: Web Safe SetTickerText

Posted: Thu Mar 12, 2015 5:12 pm
by poya
Hey Guertler,

I've pretty much finished doing all I need to do. I have one stumbling block that I don't know how to get around at the moment.

I've got a script replacing certain keywords with the correct character. It all works bar this line

replace(text, "{QUOTE}", " " ");

Now this fails because I can't use single quotations like so

replace(text, "{QUOTE}", ' " ');

and I can't escape it like so either

replace(text, "{QUOTE}", " \" ");

So I'm wondering if there is a way for my to type the " character.

Thanks in advance!

Poya

Re: Web Safe SetTickerText

Posted: Tue Mar 17, 2015 1:24 pm
by Guertler
Hello poya,
.
At the moment it is not possible to mask a double quote in a string in the MADRIX Script/Macro.
Below you can find a work around how you can solve the problem:

Code: Select all

string doublequotes ="#";  //Because you can not use the " in the macro 

                           //we use the # it is next sign after 
                          //the " in the ascii table
string singlequotes ="'";


void InitEffect()
{
	doublequotes[0]= doublequotes[0]-1; // in the ascii table " is before #
	strip(doublequotes); // remove last spaces
}

void PreRenderEffect()
{
	// get ticker text
	string text =GetText();
	
	// transform ticker text
	replace(text, singlequotes, doublequotes);
	
	// set ticker text
	SetText(text);
}

void PostRenderEffect()
{

}

void MatrixSizeChanged()
{
	InitEffect();
}