TwoStringJoinerInfotron
History Key
- New content
Removed content
Recent Versions
Choose two versions to compare, or click the link to view it.
This blueprint joins two strings and then posts the result. Actually it does more than that, since it only posts results when both strings have been send to it, so it kind of synchronizes things, right?
BLUEPRINT(
"~010B8CDB6C59CC4c5bB0A2ED265294659E",
[
["string1_in", "onString1", 1],
["string2_in", "onString2", 1]
],
[
"joined_string_out"
],
function (Class)
{
Class.prototype._onInit = function(props)
{
this._delim = props["delimiter"] || ",";
this._string1;
this._string2;
};
Class.prototype.onString1 = function(msg)
{
if (this._string2 === undefined) {
this._string1 = msg;
} else {
this.postMessage("joined_string_out",
msg + this._delim + this._string2);
}
};
Class.prototype.onString2 = function(msg)
{
if (this._string1 === undefined) {
this._string2 = msg;
} else {
this.postMessage("joined_string_out",
this._string1 + this._delim + msg);
}
};
}, "Two String Joiner");