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
hpages  
#1 Posted : Wednesday, October 28, 2020 7:30:56 AM(UTC)
hpages

Rank: Member

Groups: Registered
Joined: 8/26/2020(UTC)
Posts: 16
Man
United States
Location: Charlotte

Thanks: 1 times
So I have a script that I use for rotating data and it works great with the exception of when the last line of data in the sheet is blank. I was wondering if there was a way to modify the script below to start from the beginning if a certain text field is blank. Is this possible and how would I go about writing that script. I tried putting in an if statement before but It returned an error so I know i didnt go about it correctly.

As always, thank you for the help!

Hunter


Code:

while (true)
For i As Integer = 0 to 2

 Dim client = WebRequest.Create("http://127.0.0.1:8088/api/?Function=DataSourceSelectRow&Value=Show_Graphics,Wins_to_Date," & i  )
 Dim response = client.GetResponse()

 Sleep(10000)
Next

end while
doggy  
#2 Posted : Wednesday, October 28, 2020 8:32:21 AM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 5,209
Belgium
Location: Belgium

Thanks: 291 times
Was thanked: 954 time(s) in 789 post(s)
First off , why would your datasources have blank lines ? Then you could use to auto next and loop of your data source

but to your question, sure check for blank result and let the script appropriately respond to that.
Maybe show what you tried ?
hpages  
#3 Posted : Wednesday, October 28, 2020 9:09:21 AM(UTC)
hpages

Rank: Member

Groups: Registered
Joined: 8/26/2020(UTC)
Posts: 16
Man
United States
Location: Charlotte

Thanks: 1 times
Originally Posted by: doggy Go to Quoted Post
First off , why would your datasources have blank lines ? Then you could use to auto next and loop of your data source

but to your question, sure check for blank result and let the script appropriately respond to that.
Maybe show what you tried ?


So I have data coming in that needs to be easy entry for my directors. They enter the information into an excel sheet and I have one graphic pulling the data how it is laid out there. However, I need the data restructured into rows of five for another graphic. So I have excel pulling the data into another sheet with this information.

I have 15 lines available for entry (3 Rows) however, sometimes the data does not fully reach 15 lines. Some days we have 9 items, some days we have 11, some days 7, etc. The problem with the rows is when there is blank data in the sheet, vmix still reads the cells as active because of the formulas in the excel sheet. Because of this, the rows will always be there regardless of data, which is why i need to figure out a way to cycle back if the text field is blank.

This is what I tried earlier:

Code:


while (true)
For i As Integer = 0 to 2

Dim client = WebRequest.Create("http://127.0.0.1:8088/api/?Function=DataSourceSelectRow&Value=Show_Graphics,Wins_to_Date," & i )
Dim response = client.GetResponse()

if Input.Find("Wins_to_Date.gtzip").Text("Driver_Name_1.Text")=""

i = 0

Sleep(10000)

end if

Next


end while

doggy  
#4 Posted : Wednesday, October 28, 2020 6:17:23 PM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 5,209
Belgium
Location: Belgium

Thanks: 291 times
Was thanked: 954 time(s) in 789 post(s)
while it should work it wont do nicely as it will still display the blank one for the set pause time (add an "else" before)

your setting your x=to 0 but the "next" instruction will make it skip a line so consider another logic to loop through the list like just a do while with handling the x value (add and reset etc)

ps. always help to tell what error you are getting
hpages  
#5 Posted : Thursday, October 29, 2020 7:34:01 AM(UTC)
hpages

Rank: Member

Groups: Registered
Joined: 8/26/2020(UTC)
Posts: 16
Man
United States
Location: Charlotte

Thanks: 1 times
Originally Posted by: doggy Go to Quoted Post
while it should work it wont do nicely as it will still display the blank one for the set pause time (add an "else" before)

your setting your x=to 0 but the "next" instruction will make it skip a line so consider another logic to loop through the list like just a do while with handling the x value (add and reset etc)

ps. always help to tell what error you are getting


Thanks,

You directed me in the right direction and I was able to craft a solution.

I have it currently set up on a loop as long as "i" is less than 4 (which it will never reach) The graphic and script now work perfectly for what I was looking for.

Code:

while (true)
Dim i As Integer = 0
 do while i<4
 Dim client = WebRequest.Create("http://127.0.0.1:8088/api/?Function=DataSourceSelectRow&Value=Show Graphics,Wins to Date," & i  )
 Dim response = client.GetResponse()

if Input.Find("Winners to Date.gtzip").Text("Position 1.Text")=""
i = 0

Elseif i=3
i=0

Else Sleep(10000)

i=i+1

end if
loop
end while


any tips on consolidating or refining the code is always welcome

Thanks again!
Suhil  
#6 Posted : Wednesday, April 6, 2022 11:53:51 PM(UTC)
Suhil

Rank: Member

Groups: Registered
Joined: 4/13/2021(UTC)
Posts: 15
Germany
Location: Düsseldorf

Hi,

Can you please see what is the issue in my setting here, I tried to use your script, but my text doesn't showing other rows, just remain in first row.

title or input in vmix is: title_01.gtzip
data source name is: DATA.XLSX
text layer name: text_01.text
Excel sheet name: sheet01

Quote:

while (true)
Dim i As Integer = 0
do while i<4
Dim client = WebRequest.Create("http://127.0.0.1:8088/api/?Function=DataSourceSelectRow&Value=DATA,sheet01," & i )
Dim response = client.GetResponse()

if Input.Find("title_01.gtzip").Text("text_01.text")=""
i = 0

Elseif i=3
i=0

Else Sleep(1000)

i=i+1

end if
loop
end while

Users browsing this topic
Guest
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.