SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 4 of 4
  1. #1
    Junior Member
    Join Date
    Apr 2002
    Posts
    7
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Check with variable entry

    Hi,

    I want select a node in a tree but only, if it exist.
    I can use a check at the treeview. But the content of this tree is not static. How can I check if exist a variable Element in this tree?

    Thank you for your help!
    Stefan

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

  2. #2
    Senior Member
    Join Date
    Jun 2001
    Location
    United Kingdom
    Posts
    150
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Check with variable entry

    I don't think you can reliably find if the item exists or not.

    According to the help file you should be able to try;

    ret = TreeViewCtrl ("~1", "\Attendance User Defined\Occasionally Late1", 'Left SingleClick', 'Label')

    Which is suppost to return a 1 if the item was found or a 0 if the item doesn't exist.

    But if the item doesn't exist then the script fails. You'll find there's alot of functions that ar suppost to return 0 or 1 but just fallover......

    Simon

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

  3. #3
    Senior Member
    Join Date
    Jun 2001
    Location
    United Kingdom
    Posts
    150
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Check with variable entry

    Actually thinking about it, one thing you could try is;

    requiredNode = "myTreeNode"

    capturedText = Capture("your tree view name")

    If FindStr( capturedText, requiredNode ) <> 0
    TreeViewCtrl ("your tree view name", requiredNode, 'Left SingleClick', 'Label')

    End if

    Something like that might work,

    Simon

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

  4. #4
    Senior Member
    Join Date
    May 2001
    Posts
    489
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Check with variable entry

    Actually, Sreilly's first solution would work best. But you will need to have an error handler that just continues the script. This way you can have it return 0 when it fails.

    Function Main

    //If TreeViewCtrl errors out then continue
    On Error Call OnErrorResume

    ret = TreeViewCtrl ("~1", "\Attendance User Defined\Occasionally Late1", 'Left SingleClick', 'Label')

    If ret=1 Then
    print "Item exists in tree"
    Else
    print "Item doesn't exist in tree"
    EndIf

    End Function

    //If error then resume
    Function OnErrorResume
    Resume Next
    End Function

    ------------------
    "If your not part of the solution, there's good money to be made in prolonging the problem."

    [This message has been edited by QAGUY (edited 05-29-2002).]
    If your not part of the solution, there's good money to be made in prolonging the problem.

 

 

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.71%
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 03:51 PM.

Copyright BetaSoft Inc.