Page Index Toggle Pages: [1] 2  Send Topic Send Topic Print Print
Hot Topic (More than 10 Replies) @SelectTreeItem (Read 5082 times)
proudpoppy
Full Member
Members
***
Offline


Do What ??

Posts: 420
Location: South Carolina
Joined: Apr 7th, 2004
@SelectTreeItem
Sep 29th, 2004 at 7:23pm
Print Post Print Post  
I'm trying to get a command button to print form to default, my code is "Print = @SelectTreeItem("Record Commands Print Commands!Print form to default") when I press the button I get a "0" no printing ? I know its me, not Sesame, appreciate any examples or help, idea's. Wink I got the One-Sheet on it but I don't believe that would work for what I'm trying to do, 2. Can you do multiple SelectTreeItems from one command button?
  
Back to top
 
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2480
Joined: Aug 20th, 2003
Re: @SelectTreeItem
Reply #1 - Sep 29th, 2004 at 8:00pm
Print Post Print Post  
The code would be
Print = @SelectTreeItem("Search Update Menu!Record Commands!Printing Commands!Print Form to Default")

Yes you can do multiple SelectTreeItems from one command button.
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
proudpoppy
Full Member
Members
***
Offline


Do What ??

Posts: 420
Location: South Carolina
Joined: Apr 7th, 2004
Re: @SelectTreeItem
Reply #2 - Oct 7th, 2004 at 8:13pm
Print Post Print Post  
Two Questions:

1.How do I add the second @SelectTreeItem command to the command button, just put another statement under the first ?

2. The label of the button disappears when clicked and a "1" appears, label don't come back unless you exit search update and then go back in, any way to keep the label displayed?

                                           Thanks for all help. Smiley
  
Back to top
 
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2480
Joined: Aug 20th, 2003
Re: @SelectTreeItem
Reply #3 - Oct 7th, 2004 at 8:21pm
Print Post Print Post  
Hello,

Yes you would just put the next @SelectTreeItem underneath the first one.

I have never seen the label of the button just disappearing.  Are you sure there is no Label() call in the on element entry event of the button? 

--Edit--

I see what you are doing now. The command @SelectTreeItem() will return an integer. If it is successful it returns a 1. In your code above is "Print" the name of your button? You need to declare a variable and then set the return value to it. Ex

Code
Select All
Var vSuccess as Int

vSuccess = @SelectTreeItem("Search Update Menu!Record Commands!Printing Commands!Print Form to Default")

If vSuccess = 0 Then
{
     WriteLN("The Command Failed")
}
 

  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
proudpoppy
Full Member
Members
***
Offline


Do What ??

Posts: 420
Location: South Carolina
Joined: Apr 7th, 2004
Re: @SelectTreeItem
Reply #4 - Oct 7th, 2004 at 8:44pm
Print Post Print Post  
Yes the button name is "Print". I'll use your example.

                                                    Thanks Ray !   Wink
  
Back to top
 
IP Logged
 
proudpoppy
Full Member
Members
***
Offline


Do What ??

Posts: 420
Location: South Carolina
Joined: Apr 7th, 2004
Re: @SelectTreeItem
Reply #5 - Oct 7th, 2004 at 9:20pm
Print Post Print Post  
I'm working on a different button and its failing here's the code"

  Var vsuccess as Int

   If vSuccess = 1 then
{
   vSuccess = @SelectTreeItem("Search Update Menu!Navigation!Save Record")
     vSuccess = @SelectTreeItem("Search Update Menu!Record Commands!Search(F7)")
}
else If vSuccess = 0
{
   Writeln("The Command Failed")
}

   Help !!    Undecided
  
Back to top
 
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: @SelectTreeItem
Reply #6 - Oct 7th, 2004 at 9:36pm
Print Post Print Post  
Proudpoppy,

Where's the line to change Vsuccess from 0 to 1? Try this:

  Var vsuccess as Int

  vSuccess = @SelectTreeItem("Search Update Menu!Navigation!Save Record")
if vsuccess = 1 then
{
vSuccess = @SelectTreeItem("Search Update Menu!Record Commands!Search(F7)")
}

If vSuccess = 0
{
   Writeln("The Command Failed")
}


Now the first command will run when the button is pushed and should return a 1 if successful, thereby allowing the second line to run.

Or you could just take out the 'if vsuccess = 1...' line altogether. You'll know if it works if you are taken to Search mode.

Let me know how it does.

Steve
  
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: @SelectTreeItem
Reply #7 - Oct 7th, 2004 at 9:37pm
Print Post Print Post  
Quote:
I'm working on a different button and its failing here's the code"

  Var vsuccess as Int

   If vSuccess = 1 then
{
   vSuccess = @SelectTreeItem("Search Update Menu!Navigation!Save Record")
     vSuccess = @SelectTreeItem("Search Update Menu!Record Commands!Search(F7)")
}
else If vSuccess = 0
{
   Writeln("The Command Failed")
}

   Help !!    Undecided



Like this:
Code
Select All
Var vsuccess as Int

vSuccess = @SelectTreeItem("Search Update Menu!Navigation!Save Record")
If vSuccess = 0
{
   Writeln("The Save Command Failed")
}
Else
{
  vSuccess = @SelectTreeItem("Search Update Menu!Record Commands!Search(F7)")
  If vSuccess = 0
  {
    Writeln("The Search Command Failed")
  }
} 

  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
proudpoppy
Full Member
Members
***
Offline


Do What ??

Posts: 420
Location: South Carolina
Joined: Apr 7th, 2004
Re: @SelectTreeItem
Reply #8 - Oct 7th, 2004 at 9:46pm
Print Post Print Post  
%^&$#@##$

Both examples fail  Cry
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: @SelectTreeItem
Reply #9 - Oct 7th, 2004 at 9:49pm
Print Post Print Post  
Quote:
%^&$#@##$

Both examples fail  Cry


In what way?
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
proudpoppy
Full Member
Members
***
Offline


Do What ??

Posts: 420
Location: South Carolina
Joined: Apr 7th, 2004
Re: @SelectTreeItem
Reply #10 - Oct 7th, 2004 at 9:51pm
Print Post Print Post  
When I click the button it gives me the popup writeln box stating the command failed.
  
Back to top
 
IP Logged
 
proudpoppy
Full Member
Members
***
Offline


Do What ??

Posts: 420
Location: South Carolina
Joined: Apr 7th, 2004
Re: @SelectTreeItem
Reply #11 - Oct 7th, 2004 at 9:58pm
Print Post Print Post  
In Hammer's code example the second @selectTreeItem command is failing.

In Steve's code it also seems to be the second @SelectreeItem command thats not working.
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: @SelectTreeItem
Reply #12 - Oct 7th, 2004 at 10:08pm
Print Post Print Post  
The syntax of the tree item must be exact. It looks like the path in your original code (which Steve and I copied) is incorrect. Try this one:
Code
Select All
Var vsuccess as Int

vSuccess = @SelectTreeItem("Search Update Menu!Navigation!Save Record")
If vSuccess = 0
{
   Writeln("The Save Command Failed")
}
Else
{
  vSuccess = @SelectTreeItem("Search Update Menu!Search (F7)")
  If vSuccess = 0
  {
    Writeln("The Search Command Failed")
  }
} 

  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
proudpoppy
Full Member
Members
***
Offline


Do What ??

Posts: 420
Location: South Carolina
Joined: Apr 7th, 2004
Re: @SelectTreeItem
Reply #13 - Oct 7th, 2004 at 10:15pm
Print Post Print Post  
That did it !!

                                     Thanks Hammer & Steve  Cheesy

Boy that saves a lot of clicks !!! Thanks  Grin Grin Grin
  
Back to top
 
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: @SelectTreeItem
Reply #14 - Oct 7th, 2004 at 10:16pm
Print Post Print Post  
Awesome. It was all Erika!

Its fun to watch the pros step in and clean up. Smiley

Steve
  
Back to top
IP Logged
 
Page Index Toggle Pages: [1] 2 
Send Topic Send Topic Print Print