• If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Announcement

Collapse
No announcement yet.

setAppVar in RPG trims the leftmost spaces

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • setAppVar in RPG trims the leftmost spaces

    Hello I have an issue that is workaroundable but is undesirable. Setting an app variable to an invoice string (Char(28)) from RPG can trim the leftmost spaces. This can be problematic as the invoice is used as part of the key and must be exact. The invoices should have never really been in the system with preceding spaces to begin with, but I am trying to support some old invoice data and they happen to be stored with these preceding spaces.

    RPG That Doesn't Work how I'd like:
    Code:
    Dcl-S MyInvoice Char(28);
    MyInvoice = '  1234';
    SetAppVar('invoice': MyInvoice);
    Right now my solution is to do a Script before running the RPG and to not set it from the RPG. The JS Script:
    Code:
    setAppVar('invoice', rec.get('O2INVC'));
    success();?
    I'd rather not have to do it this way and sometimes I might not even know what the invoice will be until after some RPG runs in which case I would need to add an extra preceding character and then strip that character off from a script after or something.
    Also, doing the "Set App Variables" behavior has the same problem as the SetAppVar from RPG; I'd really like both of those to preserve the spaces.

    This was mainly tested on version Valence Framework 6.3.20251117.0, but also a little on Valence Framework 6.3.20260622.0 and both versions seemed to have this issue.

    Thanks!?
Working...
X