NetTalk Central

Author Topic: A SendPacket for every line: is this OK?  (Read 2756 times)

patrick de laet

  • Newbie
  • *
  • Posts: 35
    • View Profile
    • ShopPlus
    • Email
A SendPacket for every line: is this OK?
« on: March 18, 2012, 11:24:28 AM »
Bruce,

In order to make my source a little bit readable, I created a procedure (named _ yes, underscore). Just like the "echo()" in PHP.
Why underscore? It is less "polution" in my source and makes the HTML very readable.

To send some HTML, I have the following in my source:

_('<OL>')
    _('<LI>This line one</LI>')
    _('<LI>This line two</LI>')
    _('<LI>This line three</LI>')
_('</OL>')

The procedure is as follows:
_    Procedure(prmString)
  Code
    packet = clip(packet) & '<13,10>' & prmString
    Do SendPacket
    Return

Is this good practice?
Or does frequently calling the "Do SendPacket" generates extra overhead?

regards

Patrick De Laet


Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: A SendPacket for every line: is this OK?
« Reply #1 on: March 18, 2012, 10:13:16 PM »
I don't think the multiple calls to sendPacket will do any noticeable harm. You'd have to profile it to be sure, but I doubt it.

cheers
Bruce