/* File: HASHTABLE.QRPGLEH RPG Hashtable ala Java */ /* Copyright (C) 2005 Dieter Bender */ /* */ /* This program is free software; you can redistribute it and/or modify */ /* it under the terms of the GNU General Public License as published by */ /* the Free Software Foundation. */ /* */ /* This program is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ /* along with this program; if not, write to the Free Software */ /* Foundation, Inc., 59 Temple Place, */ /* Suite 330, Boston, MA 02111-1307 USA */ /* You might find a version at http://www.gnu.org */ /************************************************************************/ D*B CRTRPGMOD TESTHASH D*B+ DBGVIEW(*SOURCE) D*B CRTPGM TESTHASH D*B+ ACTGRP(TESTHASH) D*B+ BNDSRVPGM(HASHTABLE) /* Prototypen verwendete /COPY QRPGLEH,HASHTABLE d*KUNDE E DS extname(KUNDE) D DS1 DS qualified D Feld1 10i 0 inz(76) D Feld2 20 inz('Hugo') D Feld3 7p 0 inz(27) D DS2 DS D Feld2 20 inz('Otto') D Feld1 10i 0 inz(76) D Feld3 7p 0 inz(27) D Feld4 11 inz('Ottoisnetdo') d DS1P s * d DS2P s * /free // snip DS2P = %addr(DS2) ; put('DS1' : DS1 : %len(DS1)) ; put('DS2' : DS2 : %len(DS2)) ; clear DS1 ; DS2 = ' ' ; get('DS1' : DS1 : %len(DS1)) ; get('DS2' : DS2 : %len(DS2)) ; remove('DS1') ; if get('DS1' : DS1 : %len(DS1)) ; clear DS1 ; endif ; put('DS1' : DS1 : %len(DS1)) ; clear DS1 ; get('DS1' : DS1 : %len(DS1)) ; clearAll() ; DS1P = %addr(DS1) ; DS2P = %addr(DS2) ; put('DS1' : DS1 : %len(DS1)) ; put('DS2' : DS2 : %len(DS2)) ; clear DS1 ; DS2 = ' ' ; get('DS1' : DS1 : %len(DS1)) ; get('DS2' : DS2 : %len(DS2)) ; remove('DS1') ; if get('DS1' : DS1 : %len(DS1)) ; clear DS1 ; endif ; put('DS1' : DS1 : %len(DS1)) ; clear DS1 ; get('DS1' : DS1 : %len(DS1)) ; Return ; /end-free