
no sleep? Mar 22, 2005 16:59
Maybe I'm an old school developer who's past his prime (I still code and like to code in Delphi), but for application configuration I prefer INI files rather than XML files; I also like batch files and command line apps.
Certainly XML configuration files are all the rage and they have their place for more complicated configurations. But IMO, if your configuration is complex enough to warrant an XML file, perhaps your configuration is too complex. Or at the very least requires a GUI. But I digress.
The real point of my blog is to talk about batch file programming. I like it for doing simple things. Many people use VBScript of JScript or whatever language the Windows scripting host supports, but I find batch files are useful enough.
Except there is no "sleep" command for a batch file; Windows/DOS doesn't include sleep either. I googled for it and there are a bunch of bizarre solutions out there. I could do as some advise and download a big ole resource kit from MS and install it, or I could write a simple command line app to sleep.
This seems to be a crazy omission, but it's easy enough to roll your own sleep program:
program sleep;
{$APPTYPE CONSOLE}
uses
SysUtils;
begin
SysUtils.Sleep(StrToIntDef(ParamStr(1), 1) * 1000);
end.
For those that haven't tried to crank out a console app in Delphi, they are useful and very easy to do. They are also more macho.
Write a comment
- Required fields are marked with *.







