/* Gamelon(tm) File I/O Library Sample Code  C++ Language */

/* (C)1994 Menai Corporation(tm)  Released for public use */

 

/* Example 3a. How to put a series of objects into a    */

/* nonempty aggregate using simple Insert alterations. */

 

/* If the programmer wishes to add objects to an        */

/* aggregate which already has contents, the programmer */

/* must move into the aggregate, navigate to the        */

/* desired location for the new objects and initiate an */

/* appropriate alteration to add the objects in the     */

/* proper location. This first example places several   */

/* new objects in a particular location using multiple  */

/* individual alterations.                              */

 

/* Beginning file layout:   */

/*  {                 }     */

/*   [2]['b'][3.14159]      */

 

#include <stdlib.h>

#include "gfcursor.hpp"

 

int main(void) {

    char stringval[20] = "Carpe Diem.";

    long l = 5700304;

    int valid;

    CURSOR *c = new CURSOR("newfile");

    c>eCursorQueryValid(&valid);

    if (!valid)

      exit(1);

    c>eCursorMoveIn();

    c>eCursorMoveNext();

    c>eAltInsert();

    c>eObjWrite(stringval);

    c>eAltInsert();

    c>eObjWrite(l);

    delete c;

    return 0;

}

/* Ending file layout:                           */

/*  {                                         }  */

/*   [2]["Carpe Diem."][5700304]['b'][3.14159]   */

Download this sample source code

Return to Samples List

 Home | Product | Consulting | Programming | Reviews | Company | Site Map | Guest Book

 Menai Corporation, 1010 El Camino Real, Suite 300, Menlo Park, California 94025-4335
 800-GAMELON (800-426-3566) (US only), 650-853-6450 (voice), 650-853-6453 (fax)
 Questions about our products and services:
info@menai.com.
 Comments about this web site:
webmaster@menai.com.

Copyright © 1996-98 Menai Corporation. All Rights Reserved. Menai, Gamelon and gamelon(stylized) are worldwide trademarks of Menai Corporation, registered in the United States of America, and the .[g] logo is a worldwide trademark of Menai Corporation. All other trademarks are owned by their respective owners.