Add your User Subroutines or Functions contributions below...
Random RGB Colour - Electroguard 2/4/18
Two User Subs for creating 3-byte numbers (hhmmss, yymmdd) from time and date strings ("hh:mm:ss", "dd/mm/yy") - Electroguard 2/4/18 Used for making straight-forward numeric comparisons of times or dates, ie: which of 2 dates is the latest.
Save and Re-load parameters from a configuration file - Electroguard 2/4/18 CODE:
It allows my script to run for continued development, whereas it had
previously been stopping with 'out of memory' errors when sending output
to the browser, so that's all I'm interested in. Instead of using an accumulating variable (eg: a$=a$+"more") each line is sent directly to the HTM user sub as shown in the example snippet.The HTM user sub will accumulate each new incoming$ string into buffer$ until it reaches the assigned buffersize, which will then cause that buffered mouthful to be sent to the browser, and pause long enough for it to be digested before sending any more. Sending an empty string, ie: HTM "", will flush the existing partial buffer$ contents out to the browser, so use this after sending all the data.. buffersize=2000 incoming$="" buffer$="" HTM "first bit" + "<br>" HTM "second bit" + "<br>" HTM "" 'calling subroutine with empty string causes existing buffer contents to be flushed out to the browser wait sub HTM(incoming$) if (len(incoming$)+len(buffer$) > buffersize) or (incoming$="") then html buffer$ buffer$=incoming$ incoming$="" pause 200 'allows time for the browser to digest the current mouthful before being sent another (play with the delay to suit yourself) else buffer$=buffer$+incoming$ incoming$="" endif end sub '-------------------------------------- |
Your Pages >