home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   alt.msdos.batch.nt      Fun with Windows NT batch files      68,980 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 67,916 of 68,980   
   Kerr-Mudd, John to Dallas   
   Re: batch file structure   
   06 Jul 22 17:49:42   
   
   From: admin@127.0.0.1   
      
   On Wed, 6 Jul 2022 10:58:13 -0500   
   Dallas  wrote:   
      
   > On 7/5/2022 3:28 PM, Kerr-Mudd, John wrote:   
   > > Mostly self-documented with a 'help' section   
   > >   
   > > rem {insert datestamp}   
   > > if \%1==\ goto Usage   
   > > ...   
   > > ...   
   > > goto end   
   > > Usage:   
   > > echo %0 is a program to ...   
   > > echo Usage is %0 parm1 parm2 {parm3}   
   > > echo e.g. %0 x y does action   
   > > rem relies on (dependency) being accessible via path   
   > >   
   > >   
   >   
   > Seeing your line coded as   
   >   
   > if \%1==\ goto Usage   
   >   
   > makes me curious as to how others code that.   
   > I have been using   
   >   
   > if [%1]==[] goto Usage:   
   >   
   > because it reads well (to my eyes anyway)   
   >   
   > Note that I also tack on a colon ( : ) after a label like Usage: in a goto   
   statement just so it   
   > perfectly matches the label to jump to.   
   >   
   >   
   Yes that's better. I merely changed from my older pre-NT batch style of   
      
   if "%1 == "   
      
   that used to work, and haven't moved on since.   
      
   >   
   >   
      
      
   --   
   Bah, and indeed Humbug.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca