Topic
  • 4 replies
  • Latest Post - ‏2013-07-08T14:10:18Z by Mike.Scharnow
brobl
brobl
2 Posts

Pinned topic Using Goto

‏2013-07-05T20:01:11Z |

Hello,

 

I'm trying to use the Goto function to search for a specific ID in our module.  Here's what I have so far:

findReplaceModule_ = current
evalTop_ (NLS_("findReplaceGoto_ tabGoto_"))

 

However, all this does is opens to Goto window.  I still do not know how to input text into the window and select the Goto button. 

 

Please help. Thanks.

  • Mike.Scharnow
    Mike.Scharnow
    236 Posts

    Re: Using Goto

    ‏2013-07-07T19:25:08Z  

    Hi,

     

    Not sure, what you're trying to achieve, but perhaps you are looking for the following? (e.g. you want to go to object with absolute number 24)

    current = object(24)

    Hope this helps,
    Mike

  • brobl
    brobl
    2 Posts

    Re: Using Goto

    ‏2013-07-08T13:31:34Z  

    Hi,

     

    Not sure, what you're trying to achieve, but perhaps you are looking for the following? (e.g. you want to go to object with absolute number 24)

    current = object(24)

    Hope this helps,
    Mike

    I'm just trying to search a module by ID.  I tried using setSearchObject but it seems that ID is not considered an attribute to search by.  If I just search by an absolute number, the ID may not be correct in case it has been deleted. 

     

    Thanks for your reply

  • Mike.Scharnow
    Mike.Scharnow
    236 Posts

    Re: Using Goto

    ‏2013-07-08T13:55:27Z  
    • brobl
    • ‏2013-07-08T13:31:34Z

    I'm just trying to search a module by ID.  I tried using setSearchObject but it seems that ID is not considered an attribute to search by.  If I just search by an absolute number, the ID may not be correct in case it has been deleted. 

     

    Thanks for your reply

    Sorry, but I still don't understand completely what you want to do.

    What shall happen with the object you found? Shall it just be activated, so that the user, after the script has finished sees this object? If so, the code snippet above should help.

    If you need this object for performing some further processing, you can also use the function "object", e.g. 

    Object objCalculateMe = object(24)
    string sReqType = objCalculateMe."Requirement Type" ""

    Why do you want to use the GUI GoTo function?

  • Mike.Scharnow
    Mike.Scharnow
    236 Posts

    Re: Using Goto

    ‏2013-07-08T14:10:18Z  
    • brobl
    • ‏2013-07-08T13:31:34Z

    I'm just trying to search a module by ID.  I tried using setSearchObject but it seems that ID is not considered an attribute to search by.  If I just search by an absolute number, the ID may not be correct in case it has been deleted. 

     

    Thanks for your reply

    PS: yes, if the object is deleted, you will not be able to activate it. The same is true if your current view has a filter where your object is not shown.

    For these cases you can use a construct like 

    Module m = current
     
    string sSearchit = "3"
     
    Object oSearch
     
    bool bFound = false
     
    for oSearch in entire m do {
     
    if (oSearch."Absolute Number" "" == sSearchit) {
     
    bFound = true
     
    break
     
    }
     
    }
    if (bFound) {
    if (isDeleted (oSearch)) {
    print "Object is Deleted" 
    } else {
     print "The object's identifier is " identifier (oSearch)
    }
    }
    Updated on 2013-07-08T14:10:40Z at 2013-07-08T14:10:40Z by Mike.Scharnow