home *** CD-ROM | disk | FTP | other *** search
- //--------------------------------------------------------------------------
- // Object Scripting
- // Copyright (c) 1996, 1997 by Borland International, All Rights Reserved
- //
- // CRTL.SPP: Demonstrates script access to the C RTL by writing Albert's
- // words to a file.
- //--------------------------------------------------------------------------
- print typeid(module());
-
- //
- // Needed constants from stdio.h.
- //
- #define LPFILE long
-
- //
- // Import RTL functions. Prototypes adopted from stdio.h.
- //
- import "cw3220.dll" {
- int fclose (LPFILE __stream);
- int fflush (LPFILE __stream);
- LPFILE fopen (const char * __path, const char * __mode);
- int fputs (const char * __s, LPFILE __stream);
- int puts (const char * __s);
- }
-
- //
- // Write Albert's words to a file.
- //
- TestFile = fopen("testcrtl.txt", "w");
- fputs("\"How do I work? I grope.\" --Albert Einstein", TestFile);
- fflush(TestFile);
- fclose(TestFile);
-
-