Announcement

Collapse
No announcement yet.

Is there a Global Variable which indicates what called an application?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Is there a Global Variable which indicates what called an application?

    Is there a simple way to see what applications opened the currently running application? I want to evaluate the calling app and return to it if it meets a criteria. Otherwise a redirection must occur.
    Rod - Developer

  • #2
    I've not seen one - but if there isn't then you could create this easily yourself.

    In all the "calling" apps you want to track, at the point they call the app they can set your own global variable, e.g. [caller], with the identifier / name itself (of the calling app itself).

    So if you have 3 apps (say "app_caller1", "app_caller2", "app_caller 3") that can call a specific app (say "recipient_grid_app") - at the point they are about to call "recipient_grid_app", just before the call:

    Code:
    [caller] = "app_caller1";      // or caller2, 3 etc as appropriate
    .... and in the running app you can then have something like:

    Code:
    if ([caller] == "app_caller1") {
    	
    	// do some stuff maybe?
    	if (some stuff is true) {
    	   sc_redir("app_caller1");      // Or whatever app
    	}
    
    } elseif ([caller] == "app_caller2") {
    	
    	// do some stuff maybe?
    	if (some stuff is true) {
    	   sc_redir("app_caller2");     // Or whatever app
    	}
    	
    } elseif ([caller] == "app_caller3") {
    	
    	// do some stuff maybe?
    	if (some stuff is true) {
    	   sc_redir("app_caller3");     // Or whatever app
    	}
    	
    }

    Comment


    • #3
      Yeah thanks. This is what I was hoping to avoid just due to laziness.
      Rod - Developer

      Comment


      • #4
        Well there may be one - I just haven't looked that hard - you can see ALL the possible globals etc by clicking on the File menu and then Data in Session. If it exist think it will be in that lot!

        Comment


        • #5
          Cool idea. Thanks.
          Rod - Developer

          Comment


          • #6
            Actually - just stumbled on this.......

            Capture.JPG

            This looks like you can define variable to store the caller's name - not a lot of info on it so you'll have to play as it's not clear if this is local or global or whatever....

            Comment


            • #7
              Right in front of me. Well done. I will try it in a day or two and provide feedback if nobody else has in that time. Thanks adz1111.
              Rod - Developer

              Comment

              Working...
              X