void HashTabell::nyPost( long nokkel ) { int hashAdresse, inx; long filPos; bool fullFil = false, funnet = false; hFil.open( filNavn, ios::in | ios::binary ); if ( !hFil.is_open() ) { ShowMessage( "Filen kan ikke °apnes." ); return; } hFil.close(); //°Apner eksisterende fil hFil.open( filNavn, ios::Lin | ios::out | ios::binary ); finnPlass( nokkel, hashAdresse, inx, funnet, fullFil ); Post * blokk = new Post[ antallIBlokk ]; if ( !fullFil && !funnet ) { filPos = hashAdresse * sizeof( Post ) * antallIBlokk; hFil.seekg( filPos, ios::beg ); hFil.read( ( char * ) blokk, sizeof( Post ) * antallIBlokk ); blokk[ inx ].nokkel = nokkel; blokk[ inx ].tilstand = IBRUK; hFil.seekg( filPos, ios::beg ); hFil.write( ( char * ) blokk, sizeof( Post ) * antallIBlokk ); } hFil.close(); delete blokk; }