--------------- FIDO MESSAGE AREA==> TOPIC: 202 CLIPPER Ref: DDU00002 Date: 09/23/96 From: ED DAVIS Time: 02:04am \/To: BONG BENITEZ (Read 2 times) Subj: Deleting Records > ED> Also, indexing on the date field would help. > Is this better ? > USE INVOICES.DBF > INDEX ON DTOS(INVOICES->DATE) TO TEMPO > dele all for year(INVOICES->DATE) = year(mRange) .and. ; > month(INVOICES->DATE) = month(mRange) > PACK > USE Better, but still needs improvement. I agree with the suggestions of others that you should recycle records rather than PACK. This means you should have seperate routines - one to selectively mark records for deletion, and one (for adding records) that will seek a deleted record and re-use it. Also, make a seperate maintenance module, user selectable, that will allow the user to rebuild indexes, PACK the database(s), and compress the files of memo fields (if you use them). --- * Origin: Know when to code'm, know when to modem... (1:261/1002) --------------- FIDO MESSAGE AREA==> TOPIC: 202 CLIPPER Ref: DDU00003 Date: 09/22/96 From: JAN DOGGEN Time: 05:21pm \/To: ALBERT VAN DER WOUDE (Read 2 times) Subj: Lastrec() in shared modus Hello Albert! AVDW> I had(have) a problem appending reccords to a database. AVDW> I'm writing a program for a network trying to use the databases as AVDW> SHARED as possible. But there is a problem. If I open the database AVDW> shared the lastrec() function reports one reccord more then there AVDW> should be. This empty reccord is really there as a empty reccord AVDW> after you append reccords to the database in shared modus. If you AVDW> check it with dbase you will see that browse reports for example 6 AVDW> reccords though you only have 5. Suppose there were 3 reccords en AVDW> with append blank you added 2. If you page through the database AVDW> with edit it will stop after reccord 3, but when you type edit AVDW> again than you can see te empty reccord. This gives lot of problems AVDW> in indexing etc. You may have stumbled across the problem that appended records sometime are not visible (in dBase and probably in your app too). Make sure you COMMIT the record after you have appended it and filled its fields. Maybe you should also explicitly close the databases upon exit (you did so in between in your example code). Hope I hit the nail on the head, please reprot if the problem persists. Bye, Jan --- FleetStreet 1.13 #857 * Origin: * Point van Lighthouse BBS * OS/2 * (2:285/324.15) --------------- FIDO MESSAGE AREA==> TOPIC: 202 CLIPPER Ref: DDU00004 Date: 09/20/96 From: ROBERT GAGNE Time: 09:42pm \/To: CAREL FRIK (Read 2 times) Subj: FERROR() DOES NOTHING !?? In a messages dated 09-10-96 Carel Frik wrote to Robert Gagne: CF> What do you mean by going out of (disk)-space is not an error? There is a CF> dos-error 29 write fault. Looking at the example at Vol 1 page 2-363 CF> reference guide you will see that the file is opened as FC_NORMAL. It CF> strongly suggest that if there is a full disk it will result in an error. Hi Carel, sorry for the delay in answering, I went to a lot of testing about DOS error 29... I could not get any DOS interrupt to return it as an error code !!! About creating a file on a full disk (meaning 0 bytes of free disk space), it is possible... In order to create a file, the system have to add the "file information" to the parent directory. The required "file information" is the file name, the length, and the address of it's first cluster in the File Allocation Table (FAT). As a directory is always created with "rooms" for a certain amount of files, it takes no disk space to add a file to it as long as it have a spare "room" for it ! This is why fcreate() on a full disk will rarely fail ! Robert Gagne. --- FLAME v1.1 * Origin: Le Relais BBS Mtl, Que. Multi-Line 383-1567 (1:167/211) --------------- FIDO MESSAGE AREA==> TOPIC: 202 CLIPPER Ref: DDU00005 Date: 09/22/96 From: HELMA VAN DER LINDEN Time: 04:17pm \/To: JAN DOGGEN (Read 2 times) Subj: Scrollbar in 5.3 Hallo Jan, Op 17 Sep 96 21:26, schreef Jan Doggen aan All: JD> What would be the best way to implement a vertical scroll bar? I used the scrollbar-class included in Clipper 5.3. Would that be something? Groetjes, Helma --- GEcho 1.00 * Origin: Gebruikers doen het zonder erbij na te denken (2:282/310.2194) --------------- FIDO MESSAGE AREA==> TOPIC: 202 CLIPPER Ref: DDU00006 Date: 09/16/96 From: LARRY MIGLIONICO Time: 05:26pm \/To: AHMAD KHIARY (Read 2 times) Subj: Deleting Records Any time you use a command similar to DELETE ALL FOR or SUM etc. your program must hit every record. You might spped it up considerably if you index on the first date, then SEEK to that date, and then evaluate the second date to see if it meets your criteria. This will help especially if you are not deleting that many records in a pass. Later... --- PCBoard (R) v15.22 (OS/2) 10 * Origin: The Arsenal - 913-234-9395 (1:281/60) --------------- FIDO MESSAGE AREA==> TOPIC: 202 CLIPPER Ref: DDWQ1479 Date: 09/27/96 From: GUILLERMO SALAS Time: 09:24pm \/To: ALL (Read 2 times) Subj: R: Mouse Library Hello All, How's it going? I need opinions and somebody to point me in the direction of a good library that allow applications to support mouse use in clipper 5.x. Thanks in advance, Take care~ Guillermo Salas gsalas@execpc.com --- SLMR 2.1a ((wrong && wrong) != right) --------------- FIDO MESSAGE AREA==> TOPIC: 202 CLIPPER Ref: DDWQ1482 Date: 09/19/96 From: ROBERT LAMPING Time: 11:58pm \/To: BONG BENITEZ (Read 1 times) Subj: Adding a Field -=> Quoting Bong Benitez to ALL <=- BB> Hello ALL! BB> How do I do this ? BB> Existing: NAMES.DBF BB> LASTNAME C 40 BB> FIRSTNAM C 40 BB> MIDDLENA C 2 BB> After a year, with almost 1,000 records, I wish to BB> add a field BIRTHDAY D 8 into NAMES.DBF. How do I BB> make a program that will: BB> -Detect the existing fields of the .dbf BB> -Insert a new field into the .dbf without loss of data BB> Thanks in Advance! This is especially usefull when your client is far far away. Steps: 1. Create a function in which you list all the current database structures your application is using. See FileStruct() 2. And then use Scan( cFile, bStruct, cDrivePath ) to scan your file to check if restructing is necessary and execute restructuring if so. A file needs restructuring if a fieldname is missing, or the attributes (type, len or dec) are different. 3. Create the function ScanFile( cFile, cDrivepath ) 4. Use the function setversion and newversion in order to check only when a new version of your software is installed. 5. Create a function Restruct() which has al the scanfile() calls for each file you wish to check. Function Restruct /* * Scanning files to see if restructuring is necessary. */ Local cDrive := "c:\myapps\" Local cScreen := SaveScreen() If newversion( cDrive, "Version.dat" ) * put here your files * Example: Scanfile( "GROUPS", cdrive + "data\") Scanfile( "MGPOINTS", cdrive + "userdriv\") *..... *..... * Let your program know that the files have been scanned and processed setversion( cDrive, "Version.dat" ) Endif RestScreen( ,,,, cScreen ) Return Nil Function ScanFile( cFile, cDrivePath ) Local aStruct[0] Default File to "" Default cDrivePath to "" cFile := Upper( cFile ) If Empty( aStruct := FileStruct( cFile ) ) Tone( 1000,1 ) @ 0,0 say "No structure know for :" + Ltrim( cFile ) inkey(2) Else Scan( cFile, aStruct, cDrivePath ) Endif Return ( Nil ) Function FileStruct( cFile ) Local aStruct[0] Default File to "" cFile := Upper( cFile ) Do case case cFile == 'MGPOINTS' astruct := { ; {"CAT_C ", "N", 3, 0},; {"ONUM ", "N", 3, 0},; {"RONDE ", "C", 1, 0},; {"GROUP_C ", "N", 4, 0},; {"NUMMER ", "N", 6, 0},; {"CALCPOINT ", "L", 1, 0},; {"SCORE ", "N", 8, 2},; {"POINTS ", "N", 14, 3} ; } case cFile == 'GROUPS' aStruct := { ; {"GROUP_C ", "N", 4, 0},; {"GROUPNAME" , "C", 20, 0}, ; {"GROUPSHORT", "C", 3, 0}, ; {'GIVEPOINTS', 'L', 1, 0} ; } Endcase Return aStruct Function Scan( cScanfile, astruct, cScandrive ) LOCAL I LOCAL T LOCAL POS LOCAL aCurStruct local cScreen local alStruct local restruct := .f. local lRecRestruct := .f. if Len( astruct ) > 0 DevPos(0,0) @ 1,0 say PADC( "Version control. Scanning file : " + ; pad(cScanfile,10),MAXCOL() +1) COLOR "N/W" cScreen := savescreen() multistart() // my way to keep track of opened files. set console on /* * FDOPEN is my own function to open files, use your own method * Use your own way to open a file exclusive * Do not open index files. * Delete the necessary index files. */ if fdopen(cScanfile,,, .t., , , , .f.) // eigenlijk exclusive openen dispbegin() @ 1,0 clear DEVPOS(2,0) ? aCurStruct := dastruct() afill( alStruct := Array( len(aCurStruct)), .F. ) For i = 1 to len(astruct) if ( pos := ascan( aCurstruct, ; {|el| Upper( Trim( el[1] ) ) == ; Trim( Upper( astruct[ i, 1 ] ) ) } ) ) = 0 ? pad("+",8) dispstruct(astruct[i], "W+/N") restruct := .t. else // pos has a value > 0 // field has been found in aCurstruct alStruct[pos] := .t. lRecRestruct := .f. if ! upper(aCurstruct[pos,2]) == trim(upper(astruct[i,2])) lRecRestruct := .t. restruct := .t. elseif ! aCurstruct[pos,3] = astruct[i,3] lRecRestruct := .t. restruct := .t. elseif ! aCurstruct[pos,4] = astruct[i,4] lRecRestruct := .t. restruct := .t. endif if lRecRestruct ? "-+ " dispstruct(aCurstruct[pos], "W/N") ?? " => " dispstruct(astruct[i], "W+/N") else // ? pad("Ok",8) // dispstruct(aCurstruct[pos], "W/N") endif if restruct // exit endif endif next use if !restruct ? For pos = 1 to Len( alStruct ) if !alStruct[pos] // restruct := .t. ? pad("-",8) dispstruct( aCurStruct[ pos ], "W+/N") endif next endif if !restruct restore screen from cScreen endif dispend() if restruct @ 2,40 say "Restructing " color "W*" mempos() * modify the file * Delete temporary files delete file (cScandrive + "temp.dbf") delete file (cScandrive + "temp.dbt") delete file (cScandrive + "temp.fpt") * Rename the original files RENAME (cScandrive + cScanfile + ".dbF") TO (cScandrive + "temp.dbf") * DBT: if file(cScandrive + cScanfile + ".dbt") RENAME (cScandrive + cScanfile + ".dbt") TO (cScandrive + "temp.dbt") endif if file(cScandrive + cScanfile + ".fpt") RENAME (cScandrive + cScanfile + ".fpt") TO (cScandrive + "temp.fpt") endif * Create a new file file using the correct name fdopen( CSCANFILE ) // use your own function to create such a file. // using dbcreate() and the passed structure. BeginScreen() @ 2,40 say "Appending, this can take a while!" color "W*" append from (cScandrive + "TEMP" ) go top dbcommit() USE EndScreen() if file(cScandrive + "temp.dbf") delete file (cScandrive + "temp.DBF") endif if file(cScandrive + "temp.dbt") delete file (cScandrive + "temp.DBT") endif if file(cScandrive + "temp.fpt") delete file (cScandrive + "temp.FPT") endif DELINDICES() Remempos() @ 2,40 say "------------------------------" endif endif set console off multiclose() // my way to close files automaticly, use your own method restore screen from cScreen Endif // len(astruct) > 0 Return .t. Static Function Dispstruct(aRec, color) Local oldcolor Default color to setcolor() oldcolor := setcolor(color) ?? pad(aRec[1],10), aRec[2], str(aRec[3],3), str(aRec[4],2) setcolor(oldcolor) Return .t. Function FD_filedrive(cBestand) Return FDOPEN(cBestand, NIL, {|A,B,C,D| D}) //eval( (dataview("FDOPEN")), syno, nr, nSelindex, lExclusive, lRegister, ; // lReindex, lDisplay, lOpenindex) --- Blue Wave v2.12 [NR] * Origin: HEKOM Holland. Clipper and CDGN Headquarters. (2:2802/223) --------------- FIDO MESSAGE AREA==> TOPIC: 202 CLIPPER Ref: DDWQ1483 Date: 09/25/96 From: JOHN LIPSCOMB Time: 02:03am \/To: GAPQWK (Read 1 times) Subj: DROP DROP ___ Blue Wave/386 v2.30 [NR] --- GAPNet Enhanced * Origin: Gator's Junkyard * Anniston, AL * (205)235-2900 (1:3657/2) --------------- FIDO MESSAGE AREA==> TOPIC: 202 CLIPPER Ref: DDWQ1484 Date: 09/24/96 From: TIHOMIR PURGAR Time: 01:00am \/To: ALBERT VAN DER WOUDE (Read 1 times) Subj: Lastrec() in shared modus AVDW> What is the reason of this. AVDW> MyDatabase has 3 reccords. Example: AVDW> Use MyDatabase new ; ? Lastrec() // 3 AVDW> close MyDataBase AVDW> Use MyDatabase new shared; ? Lastrec() // 4 This 'problem' occurs on dbf's modified with dBase and opened SHARED, because dBase append Ctrl-Z at the end-of-dbf. Lastrec() in shared mode is calculated indirectly from dbf file size, not readed from header as in EXCLUSIVE mode. Regards, Grunf -!- OLX 2.2 It's only a hobby ... only a hobby ... only a --- OLMS 2.53p+ [HRSDA586] * Origin: Sprint BBS, Zagreb, Croatia * +385 1 200 9014 (2:381/112)