Seems like the xTalk spirit would say something like:

set the isbuffering to true
set the isbuffering to false
put the length of the outputbuffer
replace "me" with "you" in the outputbuffer
send outputbuffer

There would be some interesting possibilities if you could just address "the buffer" as a container and even modify it after the fact but before sending. Technically you can do the same in PHP (fetch the buffer into a variable, modify it, output it) but it's a bit messy in that case.

So what would be a good way to express this via on-rev?

in PHP scripting
ECHO or PRINT do the immediate send of a string to a browser when that line is executed...
unless you turn on Output Buffering
  ob_start()    -- Turn on output buffering

then later
   $stringToSend = ob_get_flush()
-- Flush the output buffer, return it as a string and turn off output buffering

or, at the end of the script execution,
the output buffer will automatically be sent to the browser .

The Output Control functions allow you to control when output is sent from the script. This can be useful in several different situations, especially if you need to send headers to the browser after your script has began outputting data. The Output Control functions only affect functions such as echo() and data between blocks of PHP code, and do not affect headers sent using header() or setcookie(). ob_start() This function will turn output buffering on. While output buffering is active no output is sent from the script (other than headers), instead the output is stored in an internal buffer. The contents of this internal buffer may be copied into a string variable using ob_get_contents(). To output what is stored in the internal buffer, use ob_end_flush(). Alternatively, ob_end_clean() will silently discard the buffer contents.



• Output Control Functions
        • flush — Flush the output buffer
        • ob_clean — Clean (erase) the output buffer
• ob_end_clean — Clean (erase) the output buffer and turn off output buffering • ob_end_flush — Flush (send) the output buffer and turn off output buffering
        • ob_flush — Flush (send) the output buffer
• ob_get_clean — Get current buffer contents and delete current output buffer
        • ob_get_contents — Return the contents of the output buffer
• ob_get_flush — Flush the output buffer, return it as a string and turn off output buffering
        • ob_get_length — Return the length of the output buffer
• ob_get_level — Return the nesting level of the output buffering mechanism
        • ob_get_status — Get status of output buffers
        • ob_gzhandler — ob_start callback function to gzip output buffer
        • ob_implicit_flush — Turn implicit flush on/off
        • ob_list_handlers — List all output handlers in use
        • ob_start — Turn on output buffering
        • output_add_rewrite_var — Add URL rewriter values
        • output_reset_rewrite_vars — Reset URL rewriter values
_______________________________________________
use-revolution mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution

Reply via email to