SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 4 of 4
  1. #1
    Member
    Join Date
    Dec 2007
    Posts
    167
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    How to use a object reference in different.vbs

    Hi All,
    Need help:-
    a.) created one file and saved(a.vbs)with following lines of code.
    Set objdict = CreateObject("Scripting.Dictionary")
    objdict.Add "1", "K"
    objdict.Add "2", "V"
    objdict.Add "3", "N"

    Now I want to check the number of Items or keys in objdict in another b.vbs file. I mean to say I want to use the same reference(objdict)and perform the different operation add, remove etc.
    Please let me know how can we do this.

  2. #2
    Moderator
    Join Date
    Jul 2005
    Location
    Delhi
    Posts
    15,575
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    7 Thread(s)
    Total Downloaded
    0

    Re: How to use a object reference in different.vbs

    Not possible as such. Because they run in separate threads. But there is a workaround. Look at below tool

    http://knowledgeinbox.com/downloads/.../shared-store/

  3. #3
    Super Member QAGanesh's Avatar
    Join Date
    Sep 2010
    Posts
    1,898
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to use a object reference in different.vbs

    Ronaldo,

    You could use the File System Object and read the contents of the first vbs file using the ReadAll command. Then use the ExecuteGlobal statement. This shall enable you to use the same dictionary object declared in the first vbs file.

    I hope this works out!!
    Thanks,
    Ganesh Iyer
    Winds of Change

  4. #4
    Member
    Join Date
    Dec 2007
    Posts
    167
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to use a object reference in different.vbs

    Thanks a lot Tarun... it worked....

 

 

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 11.54%
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 12:38 PM.

Copyright BetaSoft Inc.