home *** CD-ROM | disk | FTP | other *** search
-
- // REMDEM.SCR -- Remove All Record Demote Flags -- Version 1.00
- //
- // Script program for MUL - the Maximus User Language
- // MUL is (C) Copyright 1990-93 by CodeLand Australia
-
- // Originally written for Simon Blears of 3:690/601, REMDEM removes the
- // demote flag settings from all user records.
-
- char *ufile = "USER.BBS"; // Path & name of Maximus user file
- //char *ufile = "C:\\BBS\\USER.BBS"; // Path & name of Maximus user file
-
- char *banner = "REMDEM v1.00"; // Script banner
- char *desc = "Remove All Demote Flags"; // Description
-
- main () // Main program
- {
- printf ("\n%s - %s\n\n",banner,desc); // Announce
-
- if (!BaseOpen (ufile)) {
- printf ("ERROR opening user file %s\n",ufile);
- saybibi (); exit ();
- }
-
- printf("Found %d user records\n\n", BaseCount());
-
- scanufile (); // Process the user file
-
- BaseClose (); // Close the user base
- saybibi (); // Was it good for you too?
- }
-
- scanufile () // Process the user file
- {
- int rec=1;
-
- while (BaseRead (rec)) { // Read all records
-
- if (And (USRxpflag,XP_DEMOTE)) { // If expire by date
-
- printf("Removing DEMOTE flag: record %04d %s\n", rec-1, USRname);
-
- USRxpflag = And (USRxpflag, Invert (XP_DEMOTE));
- BaseWrite (rec);
- }
-
- ++rec;
- }
- }
-
- // Byebye
- saybibi ()
- {
- puts ("\nRemDem done!\n");
- }
-
- // End of script
-
-