WildFire is now supported in IceBreak Applicationserver for IBMi

37 views
Skip to first unread message

Niels Liisberg

unread,
Apr 22, 2013, 3:31:06 PM4/22/13
to firec...@googlegroups.com
The IceBreak application server for IBMi now support console Log using the WildFire protocol:

The simplest ways to debug an IceBreak ILE RPG program it just to send values of variables directly to the console. This can be achieved by the adding the following code to your RPGLE program: 


<% /free

    consoleLog('Any text can go to the console');

    *inlr = *ON;

%>

This text will now occur in the browser debugger console along with other consol log notifications:    



When you are building XML or JSON based applications you can log objets and arrays from the IceBreak XML and JSON parser directly. The following code is using both simple strings and complex JSON objects: 



<%
// Example:
// Using the "consoleLog" on Json objects
// ------------------------------------------------------------------

d pJson    s     * 
d subobj   s     * 
/include qasphdr,jsonparser 
/free

  *inlr = *ON;
  consoleLog('Demo of JSON objects. First parse a string');

  consoleLog('{ "manuid":"CASIO", "price" :123.45 }');

  pJson = json_ParseString ('{ +
    "manuid":"CASIO", +
    "price" :123.45, +
    "subobj": { +
      "a": 1, +
      "b": 2, +
      "c": 3 +
    }+
  }'
);

  if json_Error(pJson) ;
    consoleLog('Json error:' + json_Message(pJson));
    json_Close(pJson);
    return;
  endif;

  consoleLog('Json parser ran ok, now show the contents');
  consoleLogJson(pJson);

  consoleLog('Now only show the "subobj" object:');
  subobj = json_locate(pJson : 'subobj');
  consoleLogJson(subobj); 
  json_Close(pJson);

%>

Which will result in the following output in firebug / chrome console:    


Reply all
Reply to author
Forward
0 new messages