CompuServe Messages

#SaveCel weirdness

    01-Dec-94 18:47:10
Sb: #SaveCel weirdness
Fm: NAAUG 73204,3522
To: Ed Kellerman 71532,3255
Hi Ed! I just got off the phobne with Brian Rudolph… ran into some real weirdness today, reproducible weirdness, and I thought I'd run it by you in case you've seen this before. In past POCO programming, I've LoadCel()ed and SaveCel()ed with no problems, but most of the Cels were pretty small. For Larger images, I've always used the OPTICS.H pragma with no problems (memory screen allocations and such) and done all my manipulations in session. Well, my latest application needs Cels to go out on the disk, so I decided to use SaveCel("CELNAME.CEL"); as usual. No problem using 640x480x256 resolution. However, write up the folliowing and create varying sized Cels and tell me what happens on your system: main() { if (CelExists()) { SaveCel("TRIAL.CEL"); } } You should be able to save whatever Cel you've clipped with no problem. Now here's the problem. Add the line LoadCel("TRIAL.CEL"); to it and run it a few times with varying sized cels: main() { if (CelExists()) { SaveCel("TRIAL.CEL"); LoadCel("TRIAL.CEL"); } } The first time you run it with a given cel, you may get by, but the second time, you'll probably get weird messages: "File not found." when saving??? "Disk sector not found." when loading. Brian has not seen this before, neither have I, but then it's my first time I've had to send large Cels external. Like I said, I usually keep them in memory for manipulation. Is this problem reproducible on your system, have you seen this before, and are you aware of any fixes or workaround? By the way, here's a gem I wrote last week when I discovered that (itoa) is not available in POCO language… integer to ASCII. There's (atoi), but no reversal. This works beautifully: // ITOA.POC simulates the (itoa) function not available in POCO. main() { // set itoa1 to whatever value you need translated int itoa1=459; char itoa2[80]; FILE *han1; han1=fopen("itoa.tmp","w"); fprintf(han1,"%d",itoa1); fclose(han1); han1=fopen("itoa.tmp","r"); fgets(itoa2,80,han1); // itoa2 is a stringvar with the (itoa)ed value. Tah Dah. Slick eh? printf(itoa2); fclose(han1); Qtext("(itoa) of the integer complete!"); } I'm about halfway done with my forum Christmas present. Just got an article off to Barbara too. Are you writing any for next issue? -dave