home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
High Voltage Shareware
/
high1.zip
/
high1
/
DIR10
/
TLXTW110.ZIP
/
GAMEDIR.SLT
< prev
next >
Wrap
Text File
|
1993-08-22
|
2KB
|
47 lines
// Changes to the game's directory and runs the following command
// Uncomment which program you want to run and comment out the others.
// then compile. Ex: CS.exe gamedir
str command[] = "List"; //
// If your using a batch file as the command above,
// comment out the run(command)
// and uncomment the dos() command. See below.
///////////////////////////////////////////////////////////////////////////////
int i, old_chk_key;
str bbsname[8], f1[64];
main()
{
update_term();
old_chk_key=_scr_chk_key; _scr_chk_key=0;
if (getenv("f1", f1) < 1) { status_wind("F1 environment variable not found",25); _scr_chk_key=old_chk_key; return(-1); }
i = strlen(f1); if (subchr(f1, i - 1) != '\') copystr("\", f1, i, 1);
if (_entry_name == "") if (call("bbsname") == -1) { _scr_chk_key=old_chk_key; return(-1); }
bbsname = _entry_name; fill_spaces();
strcat(f1, bbsname); strcat(f1, "\"); // f1 = .dat file
newdir(f1);
_scr_chk_key=old_chk_key;
run(command,0);
// dos(command,0);
// ^ Here run is faster, but cannot handle batch files, etc. see salt.doc
newdir(_telix_dir);
_scr_chk_key=old_chk_key; return;
}
//////////////////////////////////////////////////////////////////////////////
fill_spaces() // Filters out characters illegal in DOS filenames.
{
int i, count = 0; str chr[1];
while (count < 6)
{ if (count == 0) chr = ".";else if (count == 1) chr = "+";else if (count == 2) chr = " ";
else if (count == 3) chr = "?";else if (count == 4) chr = "*";else if (count == 5) chr = "/";
i=0; while (1)
{ i = strpos(bbsname, chr, i);
if (i == -1) break; setchr(bbsname, i ,'_'); i=i+1; }++count; } return; }
///////////////////////////////////////////////////////////////////////////////