Set LabTalk string variable
BOOL LT_set_str( LPCSTR lpcszVar, LPCSTR lpcszContent )
Return TRUE if success, return FALSE if string variable is not correctly specified or string is too long.
EX1
void LT_set_str_ex1() { char szBuffer[200]; // Get the value of the string variable %L LT_get_str("%L", szBuffer, 200); // Display the value: out_str(szBuffer); // Now set it to a new value: LT_set_str("%L", "New string value!"); // Get the value of the string variable %L LT_get_str("%L", szBuffer, 200); // Display the value: out_str(szBuffer); }
EX2
//this example is to show that it's equal for LT_set_str that Origin string variable with "$" or not void LT_set_str_ex2() { bool bRet; bRet = LT_set_str("myStr$","Hello"); bRet = LT_set_str("myStr","Bye-bye"); char szBuffer[100]; LT_get_str("myStr$", szBuffer, 100); out_str("myStr$ = %s" + szBuffer);//output "myStr$ = Bye-bye" }
Sets the value of a LabTalk global string variable or a LabTalk object string property.
LT_get_str
origin.h