10 SUB CHUNK(WORD FNO, STRING S) %TITLE "WWWSUB" %IDENT "X0.3" ! ! Subroutine to output one chunk. ! ! (c) 2012 by Johnny Billquist ! ! X0.0 2012-04-12 Johnny Billquist ! Initial coding ! ! X0.1 2012-08-29 Johnny Billquist ! Removed F.BINARY handling. ! ! X0.2 2012-11-26 Johnny Billquist ! Rewrote the hex convertion routine ! ! X0.3 2021-05-18 Johnny Billquist ! Added counting of sent bytes. %INCLUDE "WWW.INC" DECLARE STRING H DEF STRING HEXDIG(WORD X) = MID$("0123456789ABCDEF",(X AND 15)+1,1) DEF STRING HEX(WORD X) H="" WHILE X>15 H=HEXDIG(X)+H X=X/16 NEXT HEX=HEXDIG(X)+H END DEF IF F.CHUNK = 0 THEN PRINT #FNO,S; ELSE PRINT #FNO,HEX(LEN(S)) PRINT #FNO,S END IF SNDLEN = SNDLEN + LEN(S) END SUB