× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



You're right, that infocenter doc is not a prototype. It is the doc for the
MI instruction. It tells you want the parms are and how to specify them.
Many MI instructions are carried up to the C level. That is the are mapped
into a C function that can be called from C or from RPG IV. 
To call it from RPG IV you need to prototype it, then bind using
BNDDIR('QC2LE') binding directory and you're off to the races!
Many MI and C functions that may be used in RPG IV are already prototyped
for you in my RPGLAB. It is free, you just need to go to
www.rpgiv.com/downloads and then select the MI and C prototypes link.
Remember, the C and MI prototypes are in /COPY members, which is in the file
name QCPYSRC in the RPGLAB.

-Bob Cozzi
www.RPGxTools.com
If everything is under control, you are going too slow.
- Mario Andretti


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of Dave Murvin
Sent: Wednesday, March 23, 2005 8:08 PM
To: rpg400-l@xxxxxxxxxxxx
Subject: Where to find out more about C's functions like cvtch and cvthc

I have been looking through the archives for information on converting 
characters to hex.  I found several sample prototypes such as the following 
from Barbara Morris:

     D cvthex1To2       Pr                  Extproc('cvthc')
      D  longReceiver                   *   Value
      D  shortSource                    *   Value
      D  receiverBytes                10i 0 Value

      D cvthex2To1       Pr                  Extproc('cvtch')
      D  shortReceiver                  *   Value
      D  longSource                     *   Value
      D  sourceBytes                  10i 0 Value

What I have not been able to find is where these procedures are documented 
so I can figure out how to use this type of procedure (and other C function 
procedures) myself.  When I search the Info Center for the Convert 
Character to Hex procedure, what I get is the following, which does not 
look like the prototypes to me.


Convert Character to Hex (CVTCH)


Op Code (Hex) Operand 1 Operand 2

1082 Receiver Source

Operand 1: Character variable scalar.

Operand 2: Character variable scalar.

Description:   Each character (8-bit value) of the string value in the 
source operand is converted to a hex digit (4-bit value) and placed in the 
receiver operand. The source operand characters must relate to valid hex 
digits or a conversion  (hex 0C01) exception is signaled.
Characters Hex Digits
Hex F0-hex F9 Hex 0-hex 9
Hex C1-hex C6 Hex A-hex F
The operation begins with the two operands left-adjusted and proceeds left 
to right until all the hex digits of the receiver operand have been filled. 
If the source operand is too small, it is logically padded on the right 
with zero characters (hex F0). If the source operand is too large, a length 
conformance  (hex 0C08) exception or an invalid operand length  (hex 2A0A) 
exception is signaled.

Substring operand references that allow for a null substring reference (a 
length value of zero) may be specified for operands 1 and 2. The effect of 
specifying a null substring reference for the source is that the bytes of 
the receiver are each set with a value of hex 00. The effect of specifying 
a null substring reference for the receiver is that no result is set.

Is there a manual on this?  If so, can someone let me know where to find 
it?  I have looked at the ILE C/C++ run time library manual and these 
functions do not appear to be there.

Thanks for the help.


Dave Murvin
DRM Enterprises, Inc.
-- 
This is the RPG programming on the AS400 / 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.





As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.