PDA

View Full Version : RPGIII: Alphafeld hochzählen



seth
28-10-04, 17:39
Hallo zusammen.

Kennt irgendjemand eine Möglichkeit ein Alphanumerisches Feld hochzuzählen?
Das Feld ist 10 Stellen lang und besteht nur aus Zahlen.

Beispielsweise "000000123"

Dieses Feld soll jetzt um 1 hochgezählt werden
("0000000124")

Die einzige Möglichkeit die ich wüsste wäre mit zwei Feldgruppen (eine 10x1 Alpha und eine 10x1 Dez) rumzuwurschteln. Was aber ziemlich aufwendig ist.

Geht das auch irgendwie einfacher??

RobertMack
28-10-04, 18:23
NUMM DOUEQ 150
MOVE ALFA NUMM* 100
ADD 1 NUMM
MOVE NUMM ALFA
ENDDO

*falls der Inhalt nicht zuverlässig ist, ggf. vorher TESTN

Gruß,
Robert

seth
28-10-04, 18:42
danke
nur leider kann man ein Alpha nicht in ein Num moven :(

RobertMack
28-10-04, 19:33
Move operations transfer all or part of factor 2 to the result field. Factor 2 remains unchanged. Factor 1 must be blank. Resulting indicators can be specified in positions 54 through 59., except for the MOVE and MOVEL operations if the result field is an array, or for the MOVEA operation if the result field is an array or array element.

In the move operations, factor 2 and the result field are generally of the same type (both numeric or both character). However, you can use the move operations to change numeric fields to character fields and character fields to numeric fields. To change a numeric field to a character field, enter the name of the numeric field in factor 2 and specify a character result field. To change a character field to a
numeric field, enter the name of the character field in factor 2 and specify a numeric result field.
Quelle: RPG Reference

seth
28-10-04, 19:42
Ok, Vielen Dank!
Ich werde es versuchen.

B.Hauser
28-10-04, 19:59
Hallo,

wenn die Daten in dem Alpha-Feld zuverlässig sind, kannst Du natürlich auch eine Datenstruktur erstellen und das Alpha-Feld mit einem numerischen Feld überlagern.
Wenn Du dann das numerische Feld hochzählst, steht der neue Wert automatisch in dem Alpha-Feld und Du sparst den MOVE.

Birgitta