×

Good News Everybody!

The new search engine is LIVE!

Please report any problems to david (at) midrange.com.




"Could these two listed program entry points possibly harm? Because it's two instead of one? The rest of the RPG program runs fine (as long as I don't call pw_rand)."

If you create the C as a *PGM with a main() then two is what I would expect. However I don't think it should matter. You are binding at the *MODULE level and the bind wouldn't work if it couldn't see pw_rand.

I'll grab the save file if I have time and take a look.

By the way ... you do know that MOVE is a deprecated opcode and has been for 15 years or so? If you must code fixed format <yuck> then use Eval for the assignment.



On May 25, 2020, at 3:44 PM, Patrik Schindler <poc@xxxxxxxxxx> wrote:

Hello Sam,

Am 25.05.2020 um 19:34 schrieb Sam_L <lennon_s_j@xxxxxxxxxxx>:

Something like this:

d pThing s * inz(*null)
c eval pThing = *null

(Had to think how to do this in fixed format...)

Thanks, compiling/linking was working with the updated statements.

For source and compilation statements of pwgen (and modules), see the savefile at https://leela.pocnet.net/~poc/pwgen.savf

Relevant content of my RPG program:

HCVTOPT(*DATETIME) ALWNULL(*USRCTL)
HOPTION(*NOXREF : *NOSECLVL : *NOSHOWCPY : *NOEXT : *NOSHOWSKP)
H*
D* Imported automatically from the physical file, so not a real statement.
DID S 64A
D*
DPW_BUF S 70A
DPW_SIZE S 10I 0
DPW_FLAGS S 10I 0
DPW_RMVCHR S *
D*
DPW_RAND PR EXTPROC('pw_rand')
D PW_BUF 70A
D PW_SIZE 10I 0 VALUE
D PW_FLAGS 10I 0 VALUE
D PW_RMVCHR *
C*
C MOVE 64 PW_SIZE
C MOVE 3 PW_FLAGS
C EVAL PW_RMVCHR = *NULL
C CALLP PW_RAND ( PW_BUF : PW_SIZE :
C PW_FLAGS : PW_RMVCHR )
C EVAL ID = %str(%addr(PW_BUF))

Compiling module with option 15 in PDM, everything else is default.

Creating the final program with:
CRTPGM PGM(NSUPDATE/DNSUPPG) MODULE(NSUPDATE/DNSUPPG PWGEN/*ALL) ENTMOD(*PGM) ACTGRP(*NEW) DETAIL(*BASIC)

Possibly interesting output from the Linker:

Type Library Object Bound Ident (translation from german headings)
*MODULE NSUPDATE DNSUPPG *YES _QRNP_PEP_DNSUPPG
*MODULE PWGEN PWGEN *YES _C_pep

C-Prototype for the function to be called:
void pw_rand(char *buf, int size, int pw_flags, char *remove)

Could these two listed program entry points possibly harm? Because it's two instead of one? The rest of the RPG program runs fine (as long as I don't call pw_rand).

Calling pw_rand still makes the *PGM crash with MCH3601. Debug Output:

PW_BUF CHAR(70) ' '
VALUE IN HEX '40404040404040404040404040404040404040404040404040404040404040404040404040404040'X
41 '404040404040404040404040404040404040404040404040404040404040'X
PW_FLAGS INT(10) 3 '00000003'X
PW_RMVCHR POINTER SPP:*NULL
PW_SIZE INT(10) 64 '00000040'X

This should fix inconsistencies about Zoned vs. Int and other question marks.

Thanks again @all for your help!

:wq! PoC

PGP-Key: DDD3 4ABF 6413 38DE - https://www.pocnet.net/poc-key.asc


--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related questions.

Help support midrange.com by shopping at amazon.com with our affiliate link: https://amazon.midrange.com


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

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

This mailing list archive is Copyright 1997-2026 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.