vMix Forums
»
General
»
General Discussion
»
Visual Basic String Manipulation
Rank: Newbie
Groups: Registered
Joined: 10/20/2021(UTC) Posts: 5 Location: Ontario Thanks: 1 times Was thanked: 1 time(s) in 1 post(s)
|
I want to pull part of the title from the active input to determine which of two cameras is active. I wrote the following test script: Quote: 'What Camera is Active Dim x as new system.xml.xmldocument x.loadxml(API.XML()) Dim ActiveInput As String = (x.SelectSingleNode("//active").InnerText) Dim ActiveQuery As String = "//input[@number=" + ActiveInput + "]/@title" Dim ActiveTitle As String = (x.SelectSingleNode(ActiveQuery).Value) Console.WriteLine(ActiveTitle)
If ActiveTitle Like "[AB] .+" Then Dim WhichCamera As String = Left(ActiveTitle, 1) Dim SceneName As String = Right(ActiveTitle, Len(ActiveTitle)-2) Console.WriteLine("Current Camera is {0}, With Scene {1}", WhichCamera, SceneName) Else Console.WriteLine("Active Output is not a camera") End If
When I save the script I get the error message: Quote: Error Line 10: BC30451: Name 'Left' is not declared
I confirmed that I got similar errors with Right and Len commands. These are standard VB commands, but they don't seem to be supported. Does anyone know of workarounds? Thanks Greg
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 12/27/2012(UTC) Posts: 5,218 Location: Belgium Thanks: 291 times Was thanked: 955 time(s) in 790 post(s)
|
Use substring
BTW it's vb.net and The left function is not available anymore (according to some google research)
|
|
|
|
vMix Forums
»
General
»
General Discussion
»
Visual Basic String Manipulation
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.
Important Information:
The vMix Forums uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close