SPONSORS:






User Tag List

Results 1 to 6 of 6
  1. #1
    Member
    Join Date
    Sep 2002
    Location
    Foster City, CA, USA
    Posts
    55
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    * in string or constant

    Is it possible to use the * to represent any number of characters in a string? For example, if I want to use a string in an Open dialog to specify the file I want to open, and I only know a part of the filename, I would use the * to represent any remaining characters:

    sPath = "c:\coffee\dark*"

    But SilkTest complains that it couldn't find it. Does anyone know what's wrong? It used to work before but now it doesn't.

  2. #2
    Senior Member
    Join Date
    Feb 2000
    Posts
    1,497
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: * in string or constant

    Show us the relevant fragments of your source code.


    John


    ------------------

  3. #3
    Senior Member
    Join Date
    Oct 2001
    Location
    NC, United States
    Posts
    148
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: * in string or constant

    usually in 'Open Dialogs' when you try opening a file like 'abc*' the open dialog "displays" the files after it filters for 'abc*' named files....so my guess is since ST could not zero in on one file it logs an error.(just guessing!!!)

    ------------------
    -gram

    [This message has been edited by gram (edited 11-14-2002).]
    -gram

  4. #4
    Member
    Join Date
    Sep 2002
    Location
    Foster City, CA, USA
    Posts
    55
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: * in string or constant

    Actually I find the * works only if you are in a drop box or treeview and you want to select an item.

    But here is sample code:
    sSelection = "E:\Attach\abc*.doc"

    OpenDialog1.TextField.SetText (sSelection)
    would not work. It needs the exact path and file name. Any way to get around this problem?


    [This message has been edited by kchan (edited 11-14-2002).]

  5. #5
    Senior Member
    Join Date
    Nov 2000
    Location
    Bloomington, IL
    Posts
    142
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: * in string or constant

    The only way I have found a way around this was to get the list of the files in the directory you know the file is in, parse out the name and then search for the string within the name of the files.

    When the file is found, the whole name is known and then you can open the file.

    MikeF

    ------------------

  6. #6
    Senior Member
    Join Date
    Dec 2001
    Location
    Bozeman, MT, USA
    Posts
    265
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: * in string or constant

    change the view to detailed list and try selecting the file from the list. I think *'s work in list controls.

    ------------------
    Ryan McCullough
    Accelrys Inc.
    ryan@accelrys.com
    Ryan McCullough
    RightNow Tech. Inc.

 

 

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 02:02 PM.

Copyright BetaSoft Inc.