× 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.



Okay, so the CL Reference for my release (V5R4), says:
"A CL variable can be passed, in which case the called procedure must
declare the field to match the variable defined in the calling procedure.
For example, if a CL procedure defines a decimal variable named &CHKNUM as
(5 0), the called procedure must declare the field as packed with 5 digits
total, with no decimal positions.
If either a decimal constant or a program variable can be passed to the
called procedure, the parameter should be defined as (15 5), and any
calling procedure must adhere to that definition. If the type, number,
order, and length of the parameters do not match between the calling and
called procedures (other than the length exception noted previously for
character constants), unpredictable results will occur. "
I don't like unpredictable results :)
I have an RPG procedure with the following prototype.
D utrmDates_newDateTime...
D PR 2 0
D oldDate...
D D value
D oldTime...
D 6 0 value
D unitsToAdd...
D 9 0 value
D unitTypeIn...
D 7A value
D newDate...
D D
D newTime...
D 6 0
And my CL code:
DCL VAR(&startDate) TYPE(*CHAR) LEN(10)
DCL VAR(&startTime) TYPE(*DEC) LEN(6 0)
DCL VAR(&delayTime) TYPE(*DEC) LEN(9 0)
DCL VAR(&delayUnits) TYPE(*CHAR) LEN(7)
DCL VAR(&endDate) TYPE(*CHAR) LEN(10)
DCL VAR(&endTime) TYPE(*DEC) LEN(6 0)

chgvar &startDate '2007-04-13'
chgvar &startTime 130000
chgvar &delayTime 30
chgvar &delayUnits 'MINUTES'

callprc prc(UTRMDATES_newDateTime) +
parm((&startDate *byVal) +
(&startTime *byVal) +
(&delayTime *byVal) +
(&delayUnits *byVal) +
(&endDate *byRef) +
(&endTime *byRef) +
)

This *seems* to work fine - my concern is the fact that my CL varibles are
*CHAR while my RPG parameters are expecting dates. How safe is it to do
what I'm doing here?

TIA,
Adam

PS - Don't ask why I'm using "real" dates, but "fake" times ... I forget.
I think this procedure started life in an environment that required
numeric times.

Attention:

The information contained in this message and or attachments is
intended only for the person or entity to which it is addressed and may contain
confidential and/or privileged material. Any review, retransmission,
dissemination or other use of, or taking of any action in reliance upon, this
information by persons or entities other than the intended recipient is
prohibited. If you received this message in error, please contact the sender
and
delete the material from any system and destroy any copies. Thank you for your
time and consideration.

Attention:

Le contenu de ce message et(ou) les fichiers ci-joints s?adressent
exclusivement à la personne ou -entité à laquelle ils sont destinés. Ils
peuvent
contenir de l?information confidentielle, protégée et(ou) classifiée. Il est
strictement interdit à toute personne ou entité autre que le(la) destinataire
prévu(e) de ce message d?examiner, de réviser, de retransmettre ou de diffuser
cette information, de prendre une quelconque action en fonction ou sur la base
de celle-ci, ou d?en faire tout autre usage. Si vous avez reçu ce message par
erreur, veuillez communiquer avec l?expéditeur(trice), supprimer ce message et
les fichiers ci-inclus de tout système, et en détruire toutes copies, qu?elles
soient électroniques ou imprimées. Nous vous remercions de votre entière
collaboration.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.