Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Move characters into a result field starting from the left.The move API allows you to move values from one variable to another, left adjusted, without any type checking. It has the same functionality as pjs.move(), but with the 'left-adjusted' paremeter always true.

Parameters

There are five parameters, 1 optional.

  1. Source name - where you are taking data from.
  2. Target name - where you will move data into.
  3. Date/Time/Timestamp format - usually used if moving time/date around, can be blank otherwise. (optional / blank)
  4. Pad - if true, this will clear out the Target variable first. (optional)
Examples
Code Block
languagejavascript
pjs.define("Name", { type: 'char', length: 3, initValue: 'MR.' });
pjs.define("First", { type: 'char', length: 6, initValue: ' SMITH' });
pjs.define("Result", { type: 'char', length: 9 });

pjs.moveLeft(Name + First, Result);
Code Block
languagejavascript
pjs.define("source1", { type: 'char', length: 5, initValue: 'ABCDE' });
pjs.define("target1", { type: 'char', length: 10, initValue: 'abcdefghij' });
 
pjs.moveLeft(source1, target1);
//target1 = ABCDEfghij
Code Block
languagejavascript
pjs.define("source1", { type: 'decimal', length: 5, decimals: 0, initValue: 12345 });
pjs.define("target1", { type: 'char', length: 10, initValue: 'abcdefghij' });
 
pjs.moveLeft(source1, target1);
//target1 = 12345fghij

 

RPG Equivalent 

MOVEL