fServe method

void fServe(
  1. String actor,
  2. StringBuffer buf,
  3. String msg,
  4. bool pr,
)
    • This is main f-Print, that handles all flowC call from every library. Do not look out unprofessionally and spam your code with print-clauses! Instead use: flow !! Actor and buf are not needed in parameter !! They are get from caller. void flow(String actor, StringBuffer buf, String msg, bool pr) DONE: To avoid messing with buffer and actor HOORAY: used local flowC(). ALL local flowC() calls this fServe() callers: 12 X usage: Short name inside class void flowServe(String actor, StringBuffer buf, String msg, bool pr) {

Implementation

void fServe(String actor, StringBuffer buf, String msg, bool pr) {
  ///  ********************************************************************
  ///  GETTING NOW  ACTOR AND BUFFER RIGHT, WHEN USED LOCAL fl()
  /// **********************************************************************
  //  TODO : is flow pushing empty rows to buffers?
  //  hklTry, add :FS:
  //  Handle flow-counter, flowI
  flowI++;
  String flowIS = flowI.toString();

  ///  Added opC: to flow-counter for easy search.
  String _flowIS = 'opC:$flowIS';
  //  ?? WHAT?   $pr:  If want true / false.
  String header = 'fs:';
  String text = '$actor$header$_flowIS $msg ';

  //  Try checking that value is not NULL, before using it in a condition
  //  && glb.st['flow']  /   Shortens output from 24 to 22 screens.
  //  HowTo  NULL Condition  OK
  //  howTo NULL  error: a nullable expression can't be used as a condition
  //  if (pr && glb.prSt['flow']) print(text); // When needed  :fServe:test:
  if (pr && glb.prSt['flow']!) print(text); // When needed  :fServe:test:

  // DONE:  Now _buf comes from caller in parameters.
  buf.writeln('$text');
  //  buf.writeln('$actor $_flowIS $msg');
  //  Code here.
  //  Form nice String (for print and/or buf) that describes ongoing operation.
}