× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.


  • Subject: Re: Opening a save file
  • From: Dave McKenzie <davemck@xxxxxxxxxx>
  • Date: Tue, 18 Jul 2000 18:01:40 -0700

Save files can be read with the normal record-IO library functions.  Here's a
skeleton pgm that reads thru a save file:

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <recio.h>
#include <xxfdbk.h>

void main( void )
{
  int          eof;
  char         savfRec[528];
  _RFILE      *savf;
  _RIOFB_T    *fb;

  savf = _Ropen("MYSAVF", "rr");

  do {
    fb = _Rreadn(savf, &savfRec, sizeof(savfRec), __DFT);
    eof = (fb->num_bytes == EOF);

    if (!eof) {

      /*  Do something with record  */

    }
  } while(!eof);

  _Rclose(savf);
  return;
}

--Dave

Adam White wrote:

> Is there a way (besides using the database api's) to open a save file.  I've
> tried using fopen() and open() but to no avail.
> I'm compiling with SYSIGCOPT(*ALL)
>
> Any help much appreciated
> Regards
> Adam White
> SLIC Systems Ltd
> adam@slic-systems.com
> www.slic-systems.com

+---
| This is the C/400 Mailing List!
| To submit a new message, send your mail to C400-L@midrange.com.
| To subscribe to this list send email to C400-L-SUB@midrange.com.
| To unsubscribe from this list send email to C400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: bob@cstoneindy.com
+---

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.