SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 7 of 7
  1. #1
    Member
    Join Date
    Feb 2007
    Location
    Israel, Tel-Aviv
    Posts
    64
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    check if Environment param exist

    Hi,

    Is there a way to check if environment param exist in runtime ?
    Regards,
    Dotan Sheich

  2. #2
    Senior Member
    Join Date
    Mar 2006
    Location
    Bristol, UK
    Posts
    1,530
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: check if Environment param exist

    yeap, I do thsi all the time, but its a bit of a hack I suppose

    Just write a simple function where the argument is the name of the environment variables.

    Within the function;

    1) suspend erroring
    2) reference the environment variable
    3) store the err.code
    4) Turn erroring back on
    5) Check error code
    6) return True of False dependent on the err.code being 0 or not

    then it you code, it would something like

    If EnvironmentVariableExist("TestEnv") Then

    ........

    End if

  3. #3
    Moderator
    Join Date
    Sep 2001
    Location
    Doncaster, UK
    Posts
    5,788
    Post Thanks / Like
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: check if Environment param exist

    Might be less hassle to use Dictionary Objects which have an Exists method:

    Set OD = CreateObject("Scripting.Dictionary")
    OD.Add "Car1","Audi"
    OD.Add "Car2","BMW"
    OD.Add "Car3","Merc"


    If OD.Exists("Car1") Then
    MsgBox "Car1 Exists"
    Else
    MsgBox "NO Car1"
    End If

    If OD.Exists("Car4") Then
    MsgBox "Car4 Exists"
    Else
    MsgBox "NO Car4"
    End If


    Mark Smith.

  4. #4
    Senior Member
    Join Date
    Mar 2006
    Location
    Bristol, UK
    Posts
    1,530
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: check if Environment param exist

    I wonder if UserRegisterFunc works for Environment?

  5. #5
    Member
    Join Date
    Feb 2007
    Location
    Israel, Tel-Aviv
    Posts
    64
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: check if Environment param exist


    how can I reference the environment parameter?
    can I do something like msgbox environment("param") ?
    Regards,
    Dotan Sheich

  6. #6
    Member
    Join Date
    Feb 2007
    Location
    Israel, Tel-Aviv
    Posts
    64
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: check if Environment param exist

    ok, I handle it.

    Thanks a lot !
    Regards,
    Dotan Sheich

  7. #7
    Senior Member
    Join Date
    Mar 2006
    Location
    Bristol, UK
    Posts
    1,530
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: check if Environment param exist

    [ QUOTE ]

    how can I reference the environment parameter?
    can I do something like msgbox environment("param") ?

    [/ QUOTE ]

    ....or strTemp = environment("param")

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 10.00%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 07:50 PM.

Copyright BetaSoft Inc.