'Determine Broadcast Address
'Define these variables somewhere at the beginning
i = 0
x = 0
x1 = 0
broadcastaddr = " "
'Create broadcast address (place somewhere at beginning)
ipaddr = ip()
for i = 1 to 3 'Last "." in the string will always be the 3rd
x = instr(ipaddr,".",x1+1) 'Starts the next search cycle one char past the last time a "." was found
x1 = x 'Sets next search location
next
broadcastaddr = left(ipaddr,x)&"255"
'Example UDP code:
' udpwrite broadcastaddr, 5001, "Help me Spock"
If there is a better way I would love to know about it. If nothing else it was fun playing with strings.