pjs.dealloc()



Frees previous allocation on a pointer.

Parameter
  1. Pointer field

Exception Handling

An Error instance will be thrown with the following properties:

  • message - The IBM i message text.

  • error - The message id.

  • help - The message help text.

Example

pjs.define("staticVal", { type: 'char', length: 5 }); pjs.define("val", { type: 'char', length: 5, based: 'ptr' }); pjs.define("ptr", { type: 'pointer' }); ptr = pjs.alloc(1); ptr = pjs.realloc(ptr, 5); val = String.all('1'); console.log("Test return value: " + String(val).trim()); staticVal = val; pjs.dealloc(ptr)

RPG Equivalent 

DEALLOC