Skip to main content
Skip table of contents

How to Handle String Variables in Script Task With More Than 4K Characters

Prior version 20.2, string variables with more than 4048 characters could not be handled in script tasks. VidiFlow now provides special script task functions for reading the content from such variables, and writing more than 4048 characters into string variables.

Behavior

In practice, strings might have large content, e.g. when a Read File Content task was used which creates such a string as output.
In order to read the content of a string with more than 4048 characters ("long string" called in the following), you can now use the function

  • com.s4m.dmm.platform.utility.VpmsStringVariableUtil.toString

For writing long string into another string variable you can use

  • com.s4m.dmm.platform.utility.VpmsStringVariableUtil.createV-pmsLongString

Examples:

Read long string into a string variable

var data = com.s4m.dmm.platform.utility.VpmsStringVariableUtil.toString(execution.getVariable("longString"));


Create a long string variable

var data = com.s4m.dmm.platform.utility.VpmsStringVariableUtil.createVpmsLongString("longString");



JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.