Drawing a blank

Hi All

i am looking for a way to build a status for my tcpip connection

i have ffound and modified a snipping of script on the forms here but for the life of me cant figure out how to build it in to something usable. the code ive got is below

[code]warning = op(‘tcpip1’).warning
error = op(‘tcpip1’).error

if warning != ‘’ or error != ‘’:
print(‘disconnected’)
else:
print(‘connected’)[/code]

Is this for a tcpip dat? For a touch in/out CHOP that’s using tcp/ip as the protocol?

Can you say a little more about your setup / what you’re after?

this is for the "tcpip’ DAT

I just want to create a status label to know weather it is connected to the specified host

Looking at the TCP/IP DAT I don’t see a member that would indicate if the operator has established a connection. I’m sure that’s there somewhere, but it doesn’t look exposed at the moment.

A client will flag a warming if it can’t connect to a host, but I’m not seeing a good way to dig in. You could try an error DAT instead and limit the scope of the error DAT to only your TCP/IP Dat. From there you could use callbacks to print when you’ve lost a connection or if you haven’t connected to your host.

I was using the op class flags to to give me if there is a warning mark as disconnected if there is no warning Mark as connected

Use a Eval DAT and add:

op('tcpip1').warning

into the Expression Parameter, now you have the warning in a Table DAT.
from here you can use a DAT Execute to set your UI.

Cheers
Markus

I get nothing when i do that

this should give you a warning if the tcp/ip DAT is not connected.

Is it in server mode maybe?
Is something connected to it?

Cheers
Markus
warningOfANode.tox (1.12 KB)