SPONSORS:






User Tag List

Results 1 to 2 of 2
  1. #1
    Guest

    Can a variable be used as a Window ID?

    I am testing an application, lets call it myApp, that may be installed in different locations for each system. In my Test Frame, I have:

    [-] window MainWin myApp
    [-] multitag "myApp*"
    [ ] "$d:\Program Files\myApp.exe[1]"
    [ ]

    The Title bar will change slightly from user to user, that is why I have the myApp*. However, the location may also be different, sometimes on drive C, others on Drive d. The path will usually stay constant, but not the drive letter.

    I have a registry value that has the location of the EXE, which is loaded into a variable, SYSRoot. I was hoping I could put a variable for the Window ID, but Silk didnt like that.

    [-] window MainWin myApp
    [ ] const id = "$" + SYSRoot + "\myApp.exe[1]"
    [ ]
    [-] multitag "myApp*"
    [ ] id
    [ ]

    Any advice on how I could get this to work?

    David Genrich



  2. #2
    Guest

    Re: Can a variable be used as a Window ID?

    Yes and No,

    Yes you can use a variable in the tag field, No you can't use it as you want to.

    Explanation:
    You can set a variable to be a tag or part of a tag, as in the following example:

    window MainWin Welcome
    tag "[Dialogbox]{sTagWelcomeDialog}"

    where sTagWelcomeDialog is a string variable.

    The way you wish to use it,
    window MainWin myApp
    const id = "$" + SYSRoot + '\myApp.exe[1]"
    multitag "myApp*"
    id

    You can use it, but My advice is that you don't need multitags if you have a caption of teh window handy! I usually disable multitags to begin with. In your case it's not adding you any extra functionality. Using multi tags is useful if you have (i18n, l10n) issues like declaring the same caption in 2 or 3 languages. or if you have multiple windows with the same caption and you want to use something else, but NOTE that multitags are an OR not AND.
    so if any one of the tags is applicable, it takes 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
  •  

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.0.9 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Questions / Answers Form provided by vBAnswers (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominatevBulletin 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 08:53 AM.

Copyright BetaSoft Inc.