hello,
i need some advice how to do in smpl + a code to reverse a full string of my keybourd .
what i have done so far is :
/*
? DIGITAL, ANALOG and SERIAL INPUTS and OUTPUTS
? (Uncomment and declare inputs and outputs as needed)
*/
// DIGITAL_INPUT?
// ANALOG_INPUT?
STRING_INPUT Key_input$[1024];
DIGITAL_INPUT Clear,Back;
?
/*
? Global Variables
? (Uncomment and declare global variables as needed)
? Note:? Be sure to initialize all declared STRING variables as needed
? ? ? ? ?For example, in Function Main: myString = "";
*/
// INTEGER
// LONG_INTEGER
// SIGNED_INTEGER
// SIGNED_LONG_INTEGER
STRING Internal_buffer[1024];
//STRING originalString[255] = "Hello, world!";
STRING reversedString[1024],DESTINATION_STRING[1024];
?INTEGER i,stringLength;
String_Function ReverseString(string SOURCE_STRING)
{
? ??
? ? ? ? stringLength = LEN(SOURCE_STRING);
? ? // Start from the end of the string and copy characters to reversedString in reverse order
? ? FOR(i = 0 to i < stringLength step 1)
? ? {
? ? ? ? reversedString[i] = SOURCE_STRING[stringLength - i - 1];
? ? }
? ? reversedString[stringLength] = ""; // Null-terminate the reversed string
?
? ? ?RETURN (reversedString);
}
CHANGE Key_input$
{
? ?// reversedString = ReverseString(Internal_buffer);
?
Internal_buffer = Key_input$ + Internal_buffer;
reversedString = ReverseString(Internal_buffer);
?
Key_shifted$ = reversedString;
}
?
?
PUSH Clear
{
Internal_buffer = "";
}
?
PUSH Back
{
if(len(Key_input$) < 0)
{
Key_shifted$ = right(Key_input$, len(Key_input$) - 1);
}
}
?
?
?
?
? /*
PUSH Back
{
if(len(TextIn$) < 0)
{
Text$ = left(TextIn$, len(TextIn$) - 1);
}
}
/*
? Main()
? Uncomment and place one-time startup code here
? (This code will get called when the system starts up)
*/
/*
Function Main()
{
? ? // TODO:? Add code here
? ? // Initialize declared global and local variables/arrays as needed.
?
? ? // WaitForInitializationComplete();
? ? // If you are reading any Input or Output variables, uncomment
? ? //? ?the WaitForInitializationComplete statement above and read
? ? //? ?them afterwards.? Input/Output variables will not have
? ? //? ?their correct values set until after the logic processor
? ? //? ?runs and propagates the values to them.
}
*/
i get erors that the function is missing ;
can someone help ,or give direction what is wrong?
?