Web Safe SetTickerText

Write here what nice effects or shows you have done with MADRIX or ask other users.

Moderator: MADRIX Team

Locked
poya
Posts: 9
Joined: Fri Jan 30, 2015 3:57 pm

Web Safe SetTickerText

Post 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
Guertler
Support
Support
Posts: 908
Joined: Tue Feb 04, 2014 10:47 am

Re: Web Safe SetTickerText

Post 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);
}
poya
Posts: 9
Joined: Fri Jan 30, 2015 3:57 pm

Re: Web Safe SetTickerText

Post 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
Guertler
Support
Support
Posts: 908
Joined: Tue Feb 04, 2014 10:47 am

Re: Web Safe SetTickerText

Post by Guertler »

Helo poya,
.
At the moment you can not send the # (%23) and ? (%3F) via HTTP to the "SCE Ticker/Scrolling Text".
poya
Posts: 9
Joined: Fri Jan 30, 2015 3:57 pm

Re: Web Safe SetTickerText

Post 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
Guertler
Support
Support
Posts: 908
Joined: Tue Feb 04, 2014 10:47 am

Re: Web Safe SetTickerText

Post 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();
}

Locked