home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Hot Shareware 35
/
hot35.iso
/
ficheros
/
9TXT
/
ZE32V270.ZIP
/
ZEUS.ZM_
/
ZEUS.ZM
Wrap
Text File
|
1996-12-12
|
2KB
|
106 lines
//-- Example Macro Script
//-- Description: Typical Zeus macro script
//-- Author: Jussi Jumppanen
int ZeusMacro(void)
{
FileNew();
set_file_name("new.txt");
put_string("************** Start of the first pass ************");
EnterLine();
//-- notice that tags work within the Zeus macro intepreter
put_string("Current File Details Extracted Using Tags");
EnterLine();
put_string("-----------------------------------------");
EnterLine();
put_string("Drive: '%s' Dir: '%s' File: '%s'", "$FDR", "$FD", "$F");
EnterLine();
//-- get the current directory and insert it into the document
string strTest;
getcwd(strTest);
put_string("Current Directory is: '%s'", strTest);
EnterLine();
//-- get some user input
string szFind1;
string szPrompt1 = "Find text:";
string szFind2;
string szPrompt2 = "Replace text:";
user_input(szPrompt1, szFind1, szPrompt2, szFind2);
//-- this is what was supplied
put_string(szPrompt1);
put_string(szFind1);
EnterLine();
put_string(szPrompt2);
put_string(szFind2);
EnterLine();
put_string("************** End of the first pass **************");
//-- now read the file back in
FileSave();
EnterLine();
EnterLine();
put_string("************** Start of the read back *************");
EnterLine();
EnterLine();
read_file("$FN");
//-- they will now appear in the search/replace dialog boxes
set_find_text(szFind1);
set_replace_text(szFind2);
//-- these are the spawn flag values
SAVE_DOCUMENT = 1;
CAPTURE_OUTPUT = 2;
CAPTURE_ERROR = 4;
ASKFOR_ARGUMENTS = 8;
DOS_COMMAND = 16;
//-- the can be combined to control the spawn session
sFlags = DOS_COMMAND & CAPTURE_OUTPUT;
spawn("fgrep BOOL z*.zpp", 0, sFlags);
char chTest = 'c';
int sTest = 66;
string szTest = "test";
put_string("Character test: ");
put_char(chTest);
Enter();
put_string("Integer test: ");
put_number(sTest);
Enter();
put_string("String test: ");
put_string(szTest);
Enter();
get_column_pos(sColumn);
get_line_pos(sLine);
put_string("Line test: ");
put_number(sLine);
Enter();
put_string("Column test: ");
put_number(sColumn);
Enter();
sCount = get_line_count();
put_string("Count test: ");
put_number(sCount);
}