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



Geert,

Programming is about understanding what you write (this is no offense to you
in particular... I'm convinced you do).  I've seen just to many people who
could not explain every single line of code in their program... just because
they always copied it from another program. (this is why I'm not so keen on
4GL tools neither).

BTW, I could also mention about not prototyping the call, not using the
boolean datatype N, using 10U 0 instead of binary notations, ... but I guess
most of us are guilty on this due to the time it requires to keep code
up-to-date (but it shouldn't be an excuse for new code).

And if speed would be an issue, I guess we would be better of with Assembler
or MI.

Kind regards,
Paul Nicolay
Systems Engineer
IBM Certified Instructor
MSP - http://www.msp.be

-----Original Message-----
From: Geert Van Landeghem [mailto:gvl@reynderseti.be]
Sent: 05 March, 2002 16:33
To: 'rpg400-l@midrange.com'
Subject: RE: API prototypes in /COPY member


Because programming is lot of copying too Paul!

(I won't use speed of execution as to defend myself :))

Kind regards,
Geert

-----Original Message-----
From: Nicolay, Paul [mailto:paul_nicolay@merck.com]
Sent: dinsdag 5 maart 2002 13:27
To: 'rpg400-l@midrange.com'
Subject: RE: API prototypes in /COPY member


Geert,

Why

C                         Movel(P)      Field1    Field2

C                   Z-Add     272           Er_BytesPr


and not

C                       Eval    Field2 = Field1

C                       Eval      Er_BytesPr = %Size(Error)

Kind regards,
Paul



-----Original Message-----
From: Geert Van Landeghem [mailto:gvl@reynderseti.be]
Sent: 05 March, 2002 13:20
To: 'rpg400-l@midrange.com'
Subject: RE: API prototypes in /COPY member


Peter,

When using the Error ds when calling a system api (f.e qusrobjd)
you first have to specify the length of your ds in field Er_BytesPr
as in the following example:

*************************************************
** Error Datastructure
*************************************************
D Error           DS
D Er_BytesPr              1      4B 0
D Er_BytesAv              5      8B 0
D Er_MsgID                9     15
D Er_Reserv              16     16
D Er_MsgDta              17    272
*************************************************

C* Object exists in Production?
C                   Movel(p)  Obj_Nam       ObjNameSel
C                   Movel(p)  Obj_Typ       ObjTyp
C                   Movel(p)  ProdLib       ObjLibSel

C* Length of error data structure
C                   Z-Add     272           Er_BytesPr

C                   Call      'QUSROBJD'
C                   Parm                    Rcv_Obj
C                   Parm                    Rcv_Len
C                   Parm      'OBJD0200'    Rcv_Fmt
C                   Parm                    ObjSel
C                   Parm                    ObjTyp
C                   Parm                    Error

C* Verifying Bytes Available
C                   Select
C* Object not found
C                   When      Er_BytesAv > 0 and
C                             (Er_MsgID = 'CPF9801' or Er_MsgID='CPF9811')
C                   Movel(p)  #NO           P_Pexist
C                   Movel(p)  #YES          P_Check
C                   When      Er_BytesAv > 0
C                   Movel(p)  '?'           P_Pexist
C                   Other
C                   Movel(p)  #YES          P_Pexist
C                   Endsl

(source makes part of a simple change management tool I'm
 writing at the moment)

Kind regards
Geert Van Landeghem



As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.