lr_save_int
Saves an integer to a parameter.
int lr_save_int( int value, const char *param_name);
| Alphabetical Listing - C Language Utility Functions |
Arguments
| Name | Comments |
|---|---|
| value | The integer value to assign to the parameter. |
| param_name | The name of the parameter. |
The lr_save_int function converts an integer to a string and saves the string in a parameter. If the parameter does not exist, it is created.
Return Values
This function returns LR_PASS on success, and a negative value on failure.
Parameterization
You cannot use standard parameterization for any arguments in this function.
Example
In the following example, lr_save_int assigns the string representation of the value of variable num times 2 to parameter param1.
int num;
num = 5;
lr_save_int(num * 2, "param1");
The value of param1 is now "10".
In the following, example, lr_save_int is used to get the seconds from a timestamp into a parameter.
long t;
time(&t);
lr_save_int(t, "secondsTimeStamp");
lr_output_message("Seconds: %s", lr_eval_string("{secondsTimeStamp}"));
// Output: Action.c(6): Seconds: 1416228733

