logo

Live Production Software Forums


Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
tomGix  
#1 Posted : Monday, January 25, 2021 1:06:31 PM(UTC)
tomGix

Rank: Newbie

Groups: Registered
Joined: 1/16/2021(UTC)
Posts: 4
United States
Location: Dublin

Thanks: 1 times

This is an excerpt of my solution that I thought may help others avoid the hours it took me to figure out the proper syntax and debug different errors. I have commented the most critical concepts to aid myself and others in updating in the future, and that should help you follow the logic as well.

VB is not my go to language and my coding is rusty. So I am certain there are more elegant solutions.

The heart of this solution is the [do while] loop which increments the data source to the next row while checking the data via reading the API.XML system state. The loop exits when the next entry is empty. I had a challenge getting DataSourceNextRow() to increment to an empty row which I solved by enumerated an unused column on the Excel Spreadsheet tab.

I hope this is helpful to some in creating similar or different solutions or just figuring out some of the syntax requirements to write these scripts.

'==========================================================================
'==========================================================================
' Checking recording status from the API xml (127.0.0.1:8088/API)
' and display in a Title Input

'==========================================================================
'============== INITIALIZE VARIABLES AND STARTING CONDITIONS ============
'==========================================================================
'define x and text, using text value read from the API.XML to control loop.
dim x as new system.xml.xmldocument
dim text as string

'define spacing, 1000 = "one row", or about 1 second at speed 2 vertical scroll for my selected font-size.
dim spacing as integer
spacing=2500

'==================== Names and Titles =================================
'Select initial row and start scroll
API.Function("DataSourceSelectRow",Value:="TransDS,Participants,0")
sleep(spacing*.7)

'Loop - keep scrolling new rows until empty
do

'Using scope of while loop to create and destruct 'xml' and 'x' to refresh api.xml data
dim xml as string = API.XML()
x.loadxml(xml)

'Read node of API.XML
'NOTE (from my API.XML: text[1]=Headings, text[2]=Messages, text[3]=Names, text[4]=Titles, text[5]=Music, text[6]=Spec. Copyright
text = (x.SelectSingleNode("//inputs//input[@title='ticker scroll.gtzip']//text[3]").InnerText)

API.Function("DataSourceNextRow",Value:="TransDS,Participants")
'note that sources for text1 and text2 are columns with same row update...
'ticker scroll.gtzip should be set to ADD with data change/update

'This sleep determines line spacing between updates
sleep(spacing*.7)


'DEBUGGING
console.writeline(text)
loop while text <> ""

====================================================

Example output
Example Output.png (65kb) downloaded 8 time(s).
Ezekiel3vs18  
#2 Posted : Saturday, January 30, 2021 7:03:43 AM(UTC)
Ezekiel3vs18

Rank: Newbie

Groups: Registered
Joined: 9/7/2017(UTC)
Posts: 6
Location: Raleigh, NC, USA

Thanks: 3 times
Was thanked: 1 time(s) in 1 post(s)
Do you the spreadsheet that works for the script that you could attach? where do you store this file and reference its location.
Users browsing this topic
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.