//--------------------------------------------------------------------------- bool __fastcall TKassa::Delete() { bool result = false; if(FID_Kassa) result = DeleteFromTable("Kassa", FID_Kassa, true); return result; }
/* ARGSUSED */ static void Destroy( Widget w ) { XmPrintShellWidget print_shell = (XmPrintShellWidget) w ; /* need to remove the pixmap from this shell: no sharing between diff shell and the same shell pointer id can come up next time */ _XmCleanPixmapCache (XtScreen(w), w); if (!print_shell->print.xp_connected) return ; /*** remove entry in the widget/XPContext table, used in the event dispatch mechanism */ DeleteFromTable(XpGetContext(XtDisplay(w)), w); _XmProcessLock(); /* unmark the screen of this print shell in this context */ XDeleteContext(XtDisplay(w), (XID)XtScreen(w), _XmPrintScreenToShellContext); /* also maintain a counter of all shells alive */ _XmPrintShellCounter -- ; _XmProcessUnlock(); }
//--------------------------------------------------------------------------- bool TRashod::Delete() { bool result = false; if(FID_Rashod) result = DeleteFromTable("Rashod", FID_Rashod, true); return result; }
int main(void) { hashADT hashTable = NewHashTable(); activityADT actividad1, actividad2, actividad3, actAux, actividad4; struct activityCDT _actividad1, _actividad2, _actividad3, _actAux, _actividad4; actInfo info1, info2, info3, info4; actividad1 = &_actividad1; /*Para no reservarles memoria y bue...*/ actividad2 = &_actividad2; actividad3 = &_actividad3; actividad4 = &_actividad4; actAux = &_actAux; info1.ID = "A"; actividad1->info = &info1; info2.ID = "B"; actividad2->info = &info2; info3.ID = "C"; actividad3->info = &info3; info4.ID = "D"; actividad4->info = &info4; printf("Prueba para ver si se insertan.\n"); printf("%s\n",InsertInTable(hashTable, actividad1)?"SI":"NO"); printf("%s\n",InsertInTable(hashTable, actividad2)?"SI":"NO"); printf("%s\n",InsertInTable(hashTable, actividad3)?"SI":"NO"); printf("%s\n",InsertInTable(hashTable, actividad4)?"SI":"NO"); printf("Prueba para ver si no se insertan, dado que ya estan insertadas.\n"); printf("%s\n",InsertInTable(hashTable, actividad1)?"SI":"NO"); printf("%s\n",InsertInTable(hashTable, actividad2)?"SI":"NO"); printf("%s\n",InsertInTable(hashTable, actividad3)?"SI":"NO"); printf("%s\n",InsertInTable(hashTable, actividad4)?"SI":"NO"); printf("Prueba para ver si busca bien.\n"); printf("%s\n", SearchInTable(hashTable, "A")->info->ID); printf("%s\n", SearchInTable(hashTable, "B")->info->ID); printf("%s\n", SearchInTable(hashTable, "C")->info->ID); printf("%s\n", SearchInTable(hashTable, "D")->info->ID); printf("Prueba para ver si se borran.\n"); printf("%s\n",DeleteFromTable(hashTable, "A")?"SI":"NO"); printf("%s\n",DeleteFromTable(hashTable, "C")?"SI":"NO"); printf("%s\n",DeleteFromTable(hashTable, "C")?"SI":"NO"); if((actAux = SearchInTable(hashTable, "A")) == NULL) printf("No ta!\n"); if((actAux = SearchInTable(hashTable, "B")) != NULL) printf("%s\n", actAux->info->ID); if((actAux = SearchInTable(hashTable, "C")) == NULL) printf("No ta!\n"); if((actAux = SearchInTable(hashTable, "D")) != NULL) printf("%s\n", actAux->info->ID); FreeHashTable(hashTable); printf(":D\n"); return 0; }