getlength print to com monitor


Recommended Posts

I cannot get "getlength" to prin to the Command/Alert window


I tried using

private string datain
private data
private length
private thetime
while (1)
      datain = device.XBEE.readUntil(asc('x'))         //read serial sentence
        ? datain                                       //display datain sentence in command/alert window
      thetime = systime()
      if (left(datain,5) == "$PUMP")                   //valid data stream
            length = getlength(datain)
            ? length        
         data = parse(datain,1,",")
            ? data
            data.time = systime()


But the "? length" does not display anything in the Command/Alert window.

Attached is complete sequence.

Help appreciated.





Link to comment
Share on other sites

Are you sure the if() is evaluating to true?  

I like to add stuff to my ? lines when I think it might have an empty value.  So instead of doing:

? length

I might do:

? "Length: " + length 

That way I know it must print something or its not going through my if().  If length is empty, it will generate an error, not just print a blank line.

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.