3

I'm trying to use some Visual Basic string manipulation functions in a Blue Prism code stage. Referencing functions like LEN, LEFT, and RIGHT throws an error:

'Len' is not declared. It may be inaccessible due to its protection level.

Is there a DLL or namespace I can import to my Business Object in order to expose and use these functions?

esqew
  • 42,425
  • 27
  • 92
  • 132
  • 1
    This question shouldn't be put on hold. While I completely agree the question itself needs some work, the core of the issue is still that the OP is asking about how to expose Visual Basic string manipulation functions in a Blue Prism code stage (which are not enabled by default). – esqew Aug 03 '18 at 15:54
  • Why is this on hold? This is a legitimate, on-topic question as it relates to Blue Prism and RPA, the answer to which would address/answer many future questions in regards to utilizing system libraries and the .NET frameworks. – Alex P Aug 06 '18 at 14:23
  • @AlexP In Stackoverflow, the community has moderation tools. The question likely went to the new questions queue and the people who found the question to be off-topic might not be familiar with BP/rpa (did a quick check on them and none have any posts in any of those two tags). Also, one person might vote it as off-topic, then the others simply followed suit seeing the already present vote. – Jerry Aug 07 '18 at 06:22
  • @Jerry There also may be some confusion after my edits to the question - it was originally tagged with `VBA` and `DLL`. – esqew Aug 07 '18 at 15:19

2 Answers2

2

LEN, LEFT, and RIGHT are available through the Microsoft.VisualBasic.dll library.

In the Code Options tab of the properties of the Initialize page of your object, add Microsoft.VisualBasic.dll as an entry in the "External References" section, and add Microsoft.VisualBasic as an entry in the "Namespace Imports" section.

After that, you can begin to use the string manipulation functions available in the Visual Basic spec.

esqew
  • 42,425
  • 27
  • 92
  • 132
-1

The function you mentioned len, left and right is already provided by BluePrism.

You have to open the calculation stage there would by default function provided by Blue prism in left bottom box called Functions. enter image description here Select Text option under that you can find the function related to string.

In visual basic, to calculate the length of string Length() function is used not Len

Vijay Dodamani
  • 264
  • 1
  • 9