External Library Functions

  • Updated

Get Valid Path

Returns the supplied file path with invalid characters stripped out and replaced with "_".

Note: The class name, "Path", is the alias of the MsCorLib.NET Assembly Function Library's System.IO.Path Class found under "End Points."

Note: This is the Microsoft core library which was loaded from the .NET framework directory "C: \Windows\Microsoft.NET\Framework64\v4.0.30319\mscorlib.dll".

Parameters

  • path (Text)

Return Type

Text

Script

    var validPath = path.Trim(); 
    var ret = "";
    var invalidChars = Context.FunctionLibraries.Path.GetInvalidPathChars();
    for (var c in invalidChars)
    {
      validPath = validPath.Replace(c.ToString(), "_");
    }
    return validPath;
  

Get Valid File Name

Returns the supplied file name with invalid characters stripped out and replaced with "_".

Note: The class name, "Path", is the alias of the MsCorLib.NET Assembly Function Library's System.IO.Path Class found under "End Points."

Note: This is the Microsoft core library which was loaded from the .NET framework directory "C: \Windows\Microsoft.NET\Framework64\v4.0.30319\mscorlib.dll".

Parameters

  • fileName (Text)

Return Type

Text

Script

  var validPath = fileName.Trim(); 
  var ret = "";
  var invalidChars = Context.FunctionLibraries.Path.GetInvalidFileNameChars();
  for (var c in invalidChars)
  {
      validPath = validPath.Replace(c.ToString(), "_");
  }
  return validPath;

Load File To Text

Returns a string with the text from the supplied file.

Note: The class name, "File", is the alias of the MsCorLib.NET Assembly Function Library's System.IO.File Class found under "End Points."

Note: This is the Microsoft core library which was loaded from the .NET framework directory "C: \Windows\Microsoft.NET\Framework64\v4.0.30319\mscorlib.dll".

Parameters

  • filePath (Text)

Return Type

Text

Script

return Context.FunctionLibraries.File.ReadAllText(filePath);

Call External Function

The CallExternalFunction function calls a specific external function. This sample function adds the supplied numbers together and returns the result.

Note: The class name, "FunctLib", is the alias of the .NET Assembly Function Library's Class found under "End Points." This is a sample assembly named InvoiceObjects.dll; see Online Resources for more information.

Parameters

  • number1 (decimal)
  • number2 (decimal)

Return Type

decimal

Script

return Context.FunctionLibraries.FunctLib.AddTwoNumbers(number1,number2);

Was this article helpful?

0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.