home bbs files messages ]

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

   comp.lang.visual.basic      MS Visual Basic discussions, NOT dot-net      10,840 messages   

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

   Message 9,121 of 10,840   
   LG to All   
   Re: trapping parameters by launch of pro   
   31 Dec 04 02:50:37   
   
   From: lg@noreply.com   
      
   Here is a snippet of code I wrote to handle command line switches that might   
   help:   
      
   --snip--   
       If IDEMode = True Then   
           strCommand = "-d -t10"   
       Else   
           strCommand = Command   
       End If   
      
       strCmdArray = Split(strCommand, " ")   
      
       For intLoop = 0 To UBound(strCmdArray)   
           strCommand = strCmdArray(intLoop)   
           Select Case Left(strCommand, 2)   
               Case "-t"   
                   If Val(Mid(strCommand, 3)) < 10 Or Val(Mid(strCommand, 3)) >   
   60 Then GoTo CmdError   
                   tmrPing.Interval = Val(Mid(strCommand, 3)) * 1000   
               Case "-d"   
                   blnDebug = True   
               Case "-?"   
                   GoTo CmdError   
               Case Else   
                   GoTo CmdError   
           End Select   
       Next   
   --snip--   
      
   As you can see, it allows for multiple command switches. This can be   
   improved of course, and IIRC I do have a rather advanced one somewhere, this   
   was just the one I found first.   
      
   Cheers   
   G   
      
   --- 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