Bartender Procedures Follow

0

Hello, I see in the documentation, that bartender automation allows for user-defined subroutes, functions, etc., but I am having trouble.

I see the documentation, but I cannot find examples anywhere

http://help.seagullscientific.com/2019/en/Subsystems/BTVBScript/Content/sib_procedures.htm#Defining_Global_Variables

 

I have a field read in from a string that contains data that I need to parse based on a separator character

I want to create a function that passes in the field and position (1, 2, or 3), but anytime I try to create the function, it yells at me with an error.

Function ParseUFs(Uf as String, Pos as Integer) As String
Return "TEST"
End Function

Procedures for All Events (Line 0): Function AIT_ParseUFs(Uf as String, Pos as Integer) As String: Expected ')'

 

For my sample input:

"Field1_Field2_Field3"

My function needs to do this:

ParseUF(Fields("Uf1"), 1) << Should return Field1

ParseUF(Fields("Uf1"), 2) << Should return Field2

ParseUF(Fields("Uf1"), 3) << Should return Field3

 

When I remove the input arguments, the error goes away, does this mean that I cannot define functions with input parameters? That kind of defeats the purpose of reusable functions in my opinion.

Any tips or tricks would be greatly appreciated.

I am on BarTender Designer 2016 R3 version 11.0.3.3094 (64-bit)

1 comments

0
Avatar
Xabier Clemente
Moderator
Comment actions Permalink

Hi Edd,

Thank you for posting your query in our Community Forums.

In order to properly help you, we would need some more context regarding what we are trying to accomplish here; since BarTender has a multitude of options that could help us, perhaps there is no need to use VB Script. This would benefit us since Type of Data" is not something used in VB Script.

Thank you in advance.

Please sign in to leave a comment.