Results 1 to 6 of 6
  1. #1
    2 Star Lounger
    Join Date
    Aug 2002
    Location
    Adelaide, South Australia, Australia
    Posts
    146
    Thanks
    5
    Thanked 5 Times in 5 Posts
    Is there any way to pass an array as the OpenArg argument when opening a form? I want to pass several opening arguments, and it would be eaier to pass them in an array than to parse them out using a specific character as a separator (which is what I'm doing at the moment). I could use the same process to take the values in an array, create a string and send them to OpenArgs, then parse them back into an array on opening the form, but there doesn't seem to be much point in the context I'm currently using.

    Thanks.

  2. #2
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts
    OpenArgs is defined as a string so I think you are stuck with what you have now.
    But it would be interesting if someone knows of a way around this.
    Regards
    John



  3. #3
    Star Lounger
    Join Date
    Dec 2009
    Location
    Bellevue, WA
    Posts
    61
    Thanks
    1
    Thanked 0 Times in 0 Posts
    John is completely correct in that OpenArgs is a string. You might want to consider making the array public and then passing information via the OpenArgs to tell the form to go look at the public array. Might be lots easier than creating the string, then parsing it again on the other side. Just a thought.

  4. #4
    2 Star Lounger
    Join Date
    Aug 2002
    Location
    Adelaide, South Australia, Australia
    Posts
    146
    Thanks
    5
    Thanked 5 Times in 5 Posts
    Sorry, John and Larry - I completely missed your postings, but appreciate your response.

    At least I know I hadn't missed something obvious, but agree that the best option might be to have an array as a global variable, so will give that a go.

    Thanks for your feedback.

    Cheers, Alison

  5. #5
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Sydney, Australia, New South Wales, Australia
    Posts
    251
    Thanks
    0
    Thanked 4 Times in 4 Posts
    I do this a lot. Split and Join are your friends.
    Join takes an array and creates a string with a certain delimter between each item. Split does the reverse.
    Consider your data when deciding on the delimter - space or comma are common, although I often use the colon ':' as the delimiter.
    It's always good to minimise the use of global variables.
    Peter

  6. #6
    2 Star Lounger
    Join Date
    Aug 2002
    Location
    Adelaide, South Australia, Australia
    Posts
    146
    Thanks
    5
    Thanked 5 Times in 5 Posts
    Why didn't I think of that? I've used Split and Join before, but completely managed to forget about them in this context!

    I do try to limit my global variables to avoid problems with values not being cleared at the right time, so this is just what I was looking for.

    Thanks, Peter.

    Cheers, Alison

Posting Permissions

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