$sockbr: Difference between revisions

From Scriptwiki
Jump to navigation Jump to search
m added page
 
m a minor fix+ links
Line 1: Line 1:
'''$sockbr'''
$sockbr is set to the number of bytes read by a [[Sockread|/sockread]] command. It is used to test whether any information was in fact read from the buffer.
$sockbr is set to the number of bytes read by a [[Sockread|/sockread]] command. It is used to test whether any information was in fact read from the buffer.


'''Example'''
'''Example'''
  on 1:sockread:testing:{
  on 1:sockread:testing:{
   if ($sockerr > 0) return
   if ([[$sockerr]] > 0) [[return]]
   :nextread
   :nextread
   sockread %temp
   sockread %temp
   if ($sockbr == 0) return
   if ($sockbr == 0) return
   if (%temp == $null) %temp = -
   if (%temp == [[$null]]) %temp = -
   echo 4 %temp
   echo 4 %temp
   goto nextread
   goto nextread
  }
  }

Revision as of 15:08, 22 October 2006

$sockbr is set to the number of bytes read by a /sockread command. It is used to test whether any information was in fact read from the buffer.

Example

on 1:sockread:testing:{
 if ($sockerr > 0) return
 :nextread
 sockread %temp
 if ($sockbr == 0) return
 if (%temp == $null) %temp = -
 echo 4 %temp
 goto nextread
}