|
I am at v7r1 as well. I believe free form d-specs cam out somewhere around
TR6.
Mark Murphy
STAR BASE Consulting, Inc.
mmurphy@xxxxxxxxxxxxxxx
-----Michael Schutte <mschutte369@xxxxxxxxx> wrote: -----
To: "RPG programming on the IBM i (AS/400 and iSeries)" <
rpg400-l@xxxxxxxxxxxx>
From: Michael Schutte <mschutte369@xxxxxxxxx>
Date: 01/08/2016 01:30PM
Subject: Re: BASE64 Encoded Character String to IFS.
We are not to that level yet. Still on V7R1.
On Fri, Jan 8, 2016 at 1:29 PM, Michael Schutte <mschutte369@xxxxxxxxx>
wrote:
We haven't started with the free D-SPECS yet. But how does that differdestination.
than what I have setup. It looks the same to me.
I'll give it try though.
On Fri, Jan 8, 2016 at 12:59 PM, Mark Murphy/STAR BASE Consulting Inc. <
mmurphy@xxxxxxxxxxxxxxx> wrote:
I would expect the prototype to look like:
dcl-pr Apr_Base64_Decode_Binary Int(10)
ExtProc('apr_base64_decode_binary');
plain_dst Char(65535) Options(*Varsize);
coded_src Pointer Value Options(*String);
end-pr;
Then call it with:
length = Apr_Base64_Decode_Binary(BinaryImage: LabelImage);
BinaryImage = %subst(BinaryImage: 1: length);
Mark Murphy
STAR BASE Consulting, Inc.
mmurphy@xxxxxxxxxxxxxxx
-----"Mark Murphy/STAR BASE Consulting Inc." <mmurphy@xxxxxxxxxxxxxxx>
wrote: -----
To: "RPG programming on the IBM i \(AS/400 and iSeries\)" <
rpg400-l@xxxxxxxxxxxx>
From: "Mark Murphy/STAR BASE Consulting Inc." <mmurphy@xxxxxxxxxxxxxxx>
Date: 01/08/2016 12:39PM
Subject: Re: BASE64 Encoded Character String to IFS.
What does the prototype for Apr_Base64_Decode_Binary look like?
Mark Murphy
STAR BASE Consulting, Inc.
mmurphy@xxxxxxxxxxxxxxx
-----Michael Schutte <mschutte369@xxxxxxxxx> wrote: -----
To: "RPG programming on the IBM i (AS/400 and iSeries)" <
rpg400-l@xxxxxxxxxxxx>
From: Michael Schutte <mschutte369@xxxxxxxxx>
Date: 01/08/2016 12:22PM
Subject: Re: BASE64 Encoded Character String to IFS.
Thank you,
So I've moved from Base64_decode and moved to Apr_Base64_Decode_Binary
In the first email, I mistaken the first parameter as the IFS
theIt's in fact, a return value. So I've changed my program to...
rc = Apr_Base64_Decode_Binary(binaryImage:%Addr(LabelImage));
BinaryImage is a field length of 65535
and LabelImage is 65535 varying.
Again, it appears to run without crashing, but I get nothing back in the
binary image. When in debug, would I?
On Fri, Jan 8, 2016 at 12:12 PM, Mark Murphy/STAR BASE Consulting Inc. <
mmurphy@xxxxxxxxxxxxxxx> wrote:
The reason you needed the +2 on the %addr() of a varying lengthcharacter
variable, is that %addr() points at the first byte of the memory spacethe
variable occupies. The first two bytes of that space is the length ofthe
value. Depending on the max length of the variable, it could be 4bytes, so
using %ADDR(varying-length variable : *DATA) is better if you have a
version of the compiler that supports it.
Since you are using %addr(binaryImage) + 2 for what I am assuming is
tooutput variable, you probably are not setting the length of thatvariable
length field, so the program thinks it is 0 even if you put somethingignores
there. Variable length strings operate quickly because the computer
anything out past the length (stored in the first 2 or 4 bytes of the
variable's memory space). You can put stuff there by using a pointer
getaddress it, but if the length portion is 0, the variable is empty.The
Mark Murphy
STAR BASE Consulting, Inc.
mmurphy@xxxxxxxxxxxxxxx
-----Michael Schutte <mschutte369@xxxxxxxxx> wrote: -----
To: "RPG programming on the IBM i / System i" <RPG400-L@xxxxxxxxxxxx>
From: Michael Schutte <mschutte369@xxxxxxxxx>
Date: 01/08/2016 11:37AM
Subject: BASE64 Encoded Character String to IFS.
I'm back to this project. A few years ago, I requested information.
information provided was great at the time, however we were able to
longerthe
USPS to send back the tracking number and just barcode it on our own
label. So taking an image and printing it on the printer was no
theirneeded.
Now the account wants to change to UPS. UPS requires us to print
thislabel. I have to believe that someone has this working.
So here's what I have so far. FYI, the type of image is GIF. I know
thisfor certain this time. The XML document told me so. :-)
Originally...
D LABELIMAGE S 65535 VARYING
D binaryImage S 65535 VARYING
After getting the encoded Base64 string from an XML document. I ran
rememberedcode.
base64_decode(%addr(LabelImage)
:%Len(LabelImage)
:%addr(binaryImage)
:%size(binaryImage));
But this was failing saying that it couldn't decode x'9F'. I
Thisback to my days using WrtNoSection in CGIDEV2 that we had to add 2 tothe
%Addr. I never understood why but I changed the code like so.image
base64_decode(%addr(LabelImage) + 2
:%Len(LabelImage)
:%addr(binaryImage) + 2
:%size(binaryImage));
This time base64_decode didn't crash however, it appears that binary
was empty in debug.Not
I was thinking that maybe it appeared that way because it was binary.
really sure how its supposed to look as this is really my first timeusing
this.
So I continued and tried to write the binaryimage to an IFS file.
notagain could be wrong, I'm just not sure what exactly I need to do.empty.
fd = open('/home/mschutte/testups.gif'
: O_WRONLY + O_CREAT + O_TRUNC
: S_IRUSR + S_IWUSR + S_IRGRP);
callp write(fd: %addr(binaryimage): %len(binaryimage));
callp close(fd);
I also tried adding the 2 to the %Addr. But the file on the IFS is
There has to be someone out there that's done this right? I hope!
I'm using Scott Klement's tools, Base64, LIBHTTP, and IFS stuff.
I'm coming up empty finding examples on the web.
-- this was original posted to MIDRANGE and denied.
So here's an update. I've found an alternative.
rc = Apr_Base64_Decode_Binary(pathname:%addr(LabelImage));
When finished rc is zero. So it appears there are no errors, but I'm
(RPG400-L)getting a file. Any suggestions on either method?
Thank you
--
This is the RPG programming on the IBM i (AS/400 and iSeries)
(RPG400-L)mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxx for any subscription related
questions.
--
This is the RPG programming on the IBM i (AS/400 and iSeries)
--mailing list--
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxx for any subscription related
questions.
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxx for any subscription related
questions.
--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxx for any subscription related
questions.
--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxx for any subscription related
questions.
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxx for any subscription related
questions.
--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxx for any subscription related
questions.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.