Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: What is your preferred way of checking for parms  (Read 2126 times)

0 Members and 1 Guest are viewing this topic.

KenL

    Topic Starter


    Beginner
    What is your preferred way of checking for parms
    « on: October 17, 2006, 03:07:51 PM »
    Just wondering if people have a favourite way of testing for parameters?

    Do you just test the total number of parameters, or each one individually?

    Thanks
    Windows XP PRO/Server 2003. Date Format DD/MM/YYYY

    GuruGary



      Adviser
      Re: What is your preferred way of checking for par
      « Reply #1 on: October 17, 2006, 04:20:05 PM »
      How about

      Code: [Select]
      @echo off
      if {%1}=={} echo No params

      QBasicMac

      • Guest
      Re: What is your preferred way of checking for par
      « Reply #2 on: October 17, 2006, 08:17:17 PM »
      Or, if you require 5 parms
      Code: [Select]
      @echo off
      if not x%6==x (
        echo Try again: Too many parms
        goto Adios
      )
      if x%5==x (
        echo Try again: Not enough parms
        goto Adios
      )
      echo Good Man, you game me 5 parms
      :Adios
      Mac