Anmelden

View Full Version : Prototyping



B.Hauser
30-12-01, 13:36
Hallo Leute,

wer kennt sich mit Prototyping aus?
Ich habe folgende Quellen:
1. Hauptprogramm: PROTOTYP0


H DEBUG DECEDIT('0,') DATEDIT(*DMY.)
************************************************** ****************
* Felddefinitionen
*--------------------*
D $count s 9 0
*
* Prototyping
*--------------------*
D XCount PR 9 0 extproc('PROTOTYP1')
D $Anzahl 9 0
************************************************** ****************
* H A U P T P R O G R A M M
************************************************** ****************
*
C dou $count = 10
C eval $count = XCount($Count)
C enddo
*
*****************
C eval *inLR = *on


2. Procedure PROTOTYP1


H DEBUG DECEDIT('0,') DATEDIT(*DMY.)
H NoMain
************************************************** ******
* Prototyping
*--------------------*
D XCount PR 9 0
D $Anzahl 9 0
************************************************** ******
* B E G I N N D E R P R O Z E D U R E N
************************************************** ******
P XCount B Export
*
D XCount PI 9 0
D $Anzahl 9 0
*
C eval $Anzahl = $Anzahl + 1
C return $Anzahl
*
P XCount E


Sowohl aus dem Hauptprogramm als auch der Procedure konnten Module erstellt werden.
Bei der Erstellung des Programms mit:


CRTPGM PGM(HAUSER/PROTOTYP0) MODULE(HAUSER/PROTOTYP0 HAUSER/PROTOTYP1) ACTGRP(PROTOTYP) OPTION(*GEN *DUPPROC *DUPVAR)


Erhalte ich folgende Fehlermeldung:


Definition für Symbol 'PROTOTYP1' nicht gefunden.
Programm PROTOTYP0 nicht erstellt.


Modul PROTOTYP1 ist in der Bibliothek HAUSER vorhanden.
Das gleiche Ergebnis erhalte ich, wenn ich aus der Procedure ein Service Programm erstelle.

Was mache ich falsch?

Vielen Dank im voraus
B. Hauser

dieterle
03-01-02, 15:54
Hallo diese eine Statement müßte geändert werden

D XCount PR 9 0 extproc('PROTOTYP1')

in

D XCount PR 9 0 extproc('XCOUNT')

Fuerchau
06-01-02, 11:45
Mit "extproc('PROTOTYP1')" definieren Sie die Prozedur "XCount" um. "extproc" definiert NICHT, wo sich die Prozedur befindet. Das wird beim CRTPGM automatisch erledigt.
Im Modul "PROTOTYP1" heißt die Prozedur weiterhin "XCount".

Lassen Sie einfach "extproc" weg !!

"extproc" kann dazu verwendet werden, externen Prozeduren andere Namen (z.B. sprechendere) in der Quelle zu geben.

B.Hauser
07-01-02, 08:24
Vielen Dank für Eure Antworten.
Mir war nicht klar, ich in diesem Fall die Prozedur (XCOUNT) und nicht das Modul PROTOTYP1 anspreche.

B. Hauser