Results 1 to 2 of 2

Thread: parameters

  1. #1
    Join Date
    Sep 2003
    Location
    Montgomery, AL
    Posts
    3

    Question Unanswered: parameters

    I have a script that I want to be able to pass 1, 2, or 3 parameters. $1 is the level of a state. $2 is the level of a city. $3 is a mode. Or at least they would be if all three parameters were passed.

    I want to be able to say

    If no parameters passed - assume the entire US and a mode everything

    If one parameter passed - check to see if it's a mode value or a state value
    If it's a state value - assume all cities in that state and a mode of everything
    If it's a mode value - assume it's that mode for the entire US

    If two parameters are passed - the first is assumed to be the state, check to see what the second is
    If it's a city - assume a mode of everything
    If it's a mode - assume that mode for all cities in that state


    I was wondering if there is a simple way to do this? Rather than some long convoluted if statement that I am currently thinking.

    Thanks in advance.

  2. #2
    Join Date
    Sep 2003
    Location
    Montgomery, AL
    Posts
    3
    nm. I found another way. Going to create an argument for the mode. Case for it and then shift the arguments if one is found after processing it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •