I'm trying to make a user module that will put a new appearing character at the end of a existing string
this is for my project of born again Minitel (sooo french).
I already made a script that works fine, and was quite straight forward to make :
Code: Select all
//////////////////////////
// retourneur de string
/////////////////////////
// parameters declaration
Var input, dummy, reset : TParameter;
Var output : TParameter;
var sl1 : UNICODESTRING;
var sl2 : UNICODESTRING;
var size : integer;
// destroy
procedure Destroy;
begin
sl1.free;
sl2.free;
end;
// initialisation : create parameters
procedure init;
begin
SetModuleColor($800080+302999);
input := createParam('in',ptTextField);
SetIsOutPut(input,false);
reset:= CreateParam('reset',PtButton);
SetIsOutput(reset,false);
output := createParam('out',ptTextField);
SetIsInPut(output,false);
size := createParam('size',ptDataField);
SetIsInPut(size,false);
end;
// Global variables
//////////////////////////////
// CallBack proc
//////////////////////////////
Procedure CallBack(n:integer);
begin
if (n = reset) then begin
IF (reset >= 1) THEN
sl2 := getStringValue(input);
end;
if (n = input) then begin
sl1 := getStringValue(input);
sl2 := sl2 + sl1
end;
SetStringValue(output,sl2);
SetValue(size,Length(sl2));
end;Code: Select all
void StringFlip::onCallBack(UsineMessage *Message)
{
if ((Message->wParam == 1) && (Message->lParam == MSG_CHANGE) && (Message->result == 1)) //received 1 on "enable" input
{
m_textNew = sdkGetEvtPChar(m_textInput); //
std::string str;
str.push_back((char)m_textNew);
sdkSetEvtPChar(m_textOutput, (AinsiCharPtr) str); // this is not working, no conversion between std::string and AinsiCharPtr
}
if ((Message->wParam == 2) && (Message->lParam == MSG_CHANGE) && (Message->result == 1)) //received 1 on "reset" input
{
sdkSetEvtPChar(m_textOutput, "");
}
}http://www.sensomusic.com/wiki/doku.php?id=sdk:code:snippets:event_parameters:
but I don't understand "what" is pPrototype->PTextTest->len; I need to declare it but how ?
well I'm stuck !
thanx for your help.
