D Danbicky Member Licensed User Longtime User Oct 12, 2015 #1 Hi Guys, I have three seekbars for R G B control of my lighting system. How can I build a string and to incorporate all of these values any ideas? The string vdata needs the following formatting: "All;custom;RVALUE;GVALUE;BVALUE;" The semicolons are parsed by hardware, the RGB values are anywhere from 0 - 255. This is my code so far: Code in Activity: Code: Sub Butt_Send_Click Dim vdata As String vdata = "All;custom;" += SeekRed.Value += ";" + SeekGreen.Value += SeekBlue.Value += ";" UDP.UDP_Command(vdata) End Sub Code in a module: Code: Sub UDP_Command(vCommand As String) Dim Packet As UDPPacket Dim data() As Byte = vCommand.GetBytes("UTF8") Packet.Initialize(data, Server_IP, Server_Port) UDPSocket1.Send(Packet) End Sub
Hi Guys, I have three seekbars for R G B control of my lighting system. How can I build a string and to incorporate all of these values any ideas? The string vdata needs the following formatting: "All;custom;RVALUE;GVALUE;BVALUE;" The semicolons are parsed by hardware, the RGB values are anywhere from 0 - 255. This is my code so far: Code in Activity: Code: Sub Butt_Send_Click Dim vdata As String vdata = "All;custom;" += SeekRed.Value += ";" + SeekGreen.Value += SeekBlue.Value += ";" UDP.UDP_Command(vdata) End Sub Code in a module: Code: Sub UDP_Command(vCommand As String) Dim Packet As UDPPacket Dim data() As Byte = vCommand.GetBytes("UTF8") Packet.Initialize(data, Server_IP, Server_Port) UDPSocket1.Send(Packet) End Sub
RandomCoder Well-Known Member Licensed User Longtime User Oct 12, 2015 #2 Try this... Code: vdata = "All;custom;" & SeekRed.Value & ";" & SeekGreen.Value & ";" & SeekBlue.Value & ";" You were nearly there Upvote 0
Try this... Code: vdata = "All;custom;" & SeekRed.Value & ";" & SeekGreen.Value & ";" & SeekBlue.Value & ";" You were nearly there
D Danbicky Member Licensed User Longtime User Oct 12, 2015 #3 Mate you are a hero, works brilliant big thanks. Dans Upvote 0