Normal Topic @SelectTreeItem() (Read 752 times)
jerry.frazier
Member
*
Offline


No personal text

Posts: 16
Location: Fort Worth, Texas
Joined: Feb 12th, 2004
@SelectTreeItem()
Feb 19th, 2004 at 3:26am
Print Post Print Post  
I have been trying to simulate a menu system simular to what had been implemented in Q&A using macros.  I have been given some advice on how to use @SelectTreeItem.  Here is my problem.  I want to place a Command Button on the form related to one of several databases in my application.  According to what I have found you cannot use @SelectTreeItem to go to any level in the tree that is not visible at the time.  In other words, when in the Add data mode in one database, I can use @SelectTreeItem to go to "Add Data Menu!Application Menu.  This works and it takes me to the menu level where I can see the structure all the way up to Application name.  I have tried to code one command to get back to the main level and one more to get to the database!form that I want to get to, however the second one never gets executed.  I tried stringing all of the variables together, but as I suspected, that failed.

Is there any way to use @SelectTreeItem in this situation, or am I just going to have to use macros?

Thanks
Jerry Frazier
  
Back to top
 
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: @SelectTreeItem()
Reply #1 - Feb 19th, 2004 at 6:26am
Print Post Print Post  
Quote:
According to what I have found you cannot use @SelectTreeItem to go to any level in the tree that is not visible at the time.  In other words, when in the Add data mode in one database, I can use @SelectTreeItem to go to "Add Data Menu!Application Menu.  This works and it takes me to the menu level where I can see the structure all the way up to Application name.  I have tried to code one command to get back to the main level and one more to get to the database!form that I want to get to, however the second one never gets executed.  I tried stringing all of the variables together, but as I suspected, that failed.


I do not see any need to make two commands, one to goto the application menu level and one to get to database!Form.  The application menu is open when you are in Add Data menu eventhough it is not visible (look at the tabs at the bottom.) You do not need to use Add data Menu!application menu!

Start using command directly from the application menu.
Following is my code that goes in the command button placed on the form named Phonebook and I execute it from Add Data Menu. My application name is also Phonebook and Address is the other form in the application that opens up using the following code.

========
var vSuccess as Int

vSuccess = @selectTreeItem( "PhoneBook!Forms!Add Data!address!Address")
if vSuccess = 1 then
Writeln ("Mission Successful")


This seems to work fine for me.


  
Back to top
 
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: @SelectTreeItem()
Reply #2 - Feb 19th, 2004 at 2:38pm
Print Post Print Post  
I also struggled with this one initially. Logically speaking, one should be able to use -
@selectTreeItem ("Add Data Menu!Application Menu!ApplicationName!Form!......")  but this does not work. Obviously the form from which this command is originated is also not closing. I am wondering, why does this command fail to work?  Is this the rule that we are always supposed to start at the top and does not reverse the flow (Application Menu being at the top)?  I am trying to understand logic or any unwritten rule while using @SelectTreeItem ( ) command.
  
Back to top
 
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: @SelectTreeItem()
Reply #3 - Feb 21st, 2004 at 7:45am
Print Post Print Post  
This topic is really belongs in the sequence of the topic "Programming Command Buttons" started by Jerry Fraizer while attempting to build a menu system in Sesame.  My questions are -

1. Is there any way to merge the topics so that the reader gets the full benefit and relevance of the topic as pertains to the task.

2. Once again the same question asked earlier in this link as to why does @SelectTreeItem Command Fail to work in the given scenario? Is it a bug or that is the way it is supposed to work? If later, what is the logic behind it?

  
Back to top
 
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: @SelectTreeItem()
Reply #4 - Feb 21st, 2004 at 1:51pm
Print Post Print Post  
Quote:
I also struggled with this one initially. Logically speaking, one should be able to use - 
@selectTreeItem ("Add Data Menu!Application Menu!ApplicationName!Form!......")  but this does not work. Obviously the form from which this command is originated is also not closing. I am wondering, why does this command fail to work?  Is this the rule that we are always supposed to start at the top and does not reverse the flow (Application Menu being at the top)?  I am trying to understand logic or any unwritten rule while using @SelectTreeItem ( ) command.


There are three trees. Each is a separate hierarchy. When you get to a "leaf" on any one of them, even if that "leaf" (or command) invokes a different tree - it cannot become a "branch" and have elements "under" it. So when you get to:

@selectTreeItem ("Add Data Menu!Application Menu")

You are actually executing the command "Go to the application tree". You are not placing the "application tree" under that branch of the "Add Data" tree.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged