ajBigStrRept function
Description
Repeats Big String text a given number of times.
Syntax
ajBigStrRept(memory_id, number_times, [run_condition], [run_by_function_point_only])
Argument Name | Argument Type | Description |
---|---|---|
memory_id (big string ID) (required) | String | The ID of the big string or text you want to repeat. A big string ID can be retrieved from ajBigStrSet() or configure Big String value from More Tools tab in AlchemyJ ribbon. |
number_times (required) | Long | Number of times to repeat Big String text. It should be a positive value. |
run_condition (optional) | Boolean | The function will run when the value is TRUE. Otherwise will not run. The default value is TRUE. |
run_by_function_point_only (optional) | Boolean | If it equals FALSE, the function can be executed through ‘Excel Calculation’ (can be either Automatic or Manual, Calculate Now or Calculate Sheet) or Preview Function Point. If it equals TRUE, the function can be executed with Preview Function Point (AlchemyJ ribbon \ Preview Function Point) only. The default value is TRUE. |
The function will return:
1) Return Value: Big String
2) Return Type: Single Value
Example
In this example, we will demonstrate how to repeat a Big String text a specific number of times. The plan is to repeat it 3 times so that the end result would be 'abcabcabc'
The Big String value we have used here is 'abc'. To use the ajBigStrRept formula, firstly we have to convert 'abc' into a big string ID. This is done using the ajBigstrSet formula.
After converting into a big string ID, we can then use the formula as shown in B8 and it will return a Big String value.
To verify the result, we can use the ajBigStrValue formula in B10 to make it into a normal String. As seen in B11, we have successfully repeated the Big String text 3 times to become 'abcabcabc'.
Click here to download the use case workbooks for further reference.
Error Scenarios
It will return #VALUE! when missing any required parameter or mismatch parameter type. Besides, system will also raise error for below scenario(s).
Error Scenario |
---|
Big String ID does not exist. |
Number times should be greater than zero. |