Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/Delphi/Bille 0.71/__history/     Datei vom 9.0.2013 mit Größe 18 kB image not shown  

SSL tally.cob   Sprache: Cobol

 

      identification division.
      program-id. tall.
      * am 9.4.9 aus cobollang
      * 184.html in cobug
      WORKING-STORAGE SECTION. 
      *... 
       01 inputNumber pic x(20). 
       01 outputNumber. 
        12 outNum pic x(18). 
        12 filler pic xx value space. 
      
       01 usefulNumbers usage comp. 
        12 MyTally pic s9(4). 
        12 numLength pic s9(4). 
        12 outOffset pic s9(4). 
      *... 
      PROCEDURE DIVISION. 
      *... 
       move zero to myTally numLength outputNumber 
       inspect function REVERSE (inputNumber) 
      *> count TRAILING SPACES ONLY 
       TALLYING myTally FOR 
       LEADING SPACES 
       compute numLength = 20 - myTally 
       if numLength > 4 
        compute outOffset = 22 - numLength 
        move inputNumber (4:numLength - 3) to outNum (outOffset:) 
       else 
      *> input was all spaces or an invalid number 
      *> do whatever you need to here... 
       end-if       

Messung
CHZG
889810095

¤ Dauer der Verarbeitung: 0.44 Sekunden  ¤

*© Formatika GbR, Deutschland