SPECIAL>ALIASSCREEN command
Moderator: Administrator
-
- Member
- Posts: 28
- Joined: Thu Aug 07, 2003 6:15 pm
SPECIAL>ALIASSCREEN command
In a sable application that I am developing, I want to move back and forth form different screens to one single specific screen. Is there any way to set up a return button on that single screen that by clicking on it, the system will return to the previous screen no matter which screen was the previous one?
In Venapp yo can do it by using SPECIAL>ALIASSCREEN command. But this command is not available form within sable. I appreciate any hint.
[Edited on 14-8-2003 by mashayekhi]
In Venapp yo can do it by using SPECIAL>ALIASSCREEN command. But this command is not available form within sable. I appreciate any hint.
[Edited on 14-8-2003 by mashayekhi]
In Sable, you will need to use SableScript.
1. First, open the text editor by selecting View > View Text Editor from the main menu in Sable.
2. Next enter the script code given below.
3. Save the file as ExtProg.vts in the SCRIPTS sub directory of the project.
4. Reopen the project to allow Sable to read in the script code. If you modify the code, you will need to reopen the project in order for Sable to update to the new code.
Here is the code:
-----------------------------------------------------
global sourcescreenid as integer
sub movetoscreen(byval sourcescreen as string)
// This routine will check to see which screen the user is clicking in from, and set
// a value for "sourcescreenid" unique to that screen
// "sourcescreen" is a piece of text past to this routine from the Sable button command set in the project.
if (sourcescreen = "TestScreen1")
sourcescreenid=1
end if
if (sourcescreen = "TestScreen2")
sourcescreenid=2
end if
// Finally, execute the move to the intended screen (the one that many screens can click into, but
// you want a single return button to return to the source screen)
call MoveToMainScreen("Intro.vnn")
end sub
sub returntoscreen()
// This routine interogates the global variable "sourcescreenid" and moves the user to the desired source
// screen.
dim nextscreen as string
if (sourcescreenid = 1)
nextscreen = "Test Screen 1.vnn"
end if
if (sourcescreenid = 2)
nextscreen = "Test Screen 2.vnn"
end if
call MoveToMainScreen(nextscreen)
end sub
-----------------------------------------------------
In sable, for the button to click to the common screen, use the XCommand "Execute Script" (eg. in my example, the command is Execute Script:SableScript.movetoscreen(TestScreen1)) making sure you enter the correct unique arguement for the source screen.
In Sable, for the return button, use the XCommand "Execute Script" (in my example; Execute Script:SableScript.returntoscreen()) Note there are no arguements to this routine.
I hope this is clear.
Lee
1. First, open the text editor by selecting View > View Text Editor from the main menu in Sable.
2. Next enter the script code given below.
3. Save the file as ExtProg.vts in the SCRIPTS sub directory of the project.
4. Reopen the project to allow Sable to read in the script code. If you modify the code, you will need to reopen the project in order for Sable to update to the new code.
Here is the code:
-----------------------------------------------------
global sourcescreenid as integer
sub movetoscreen(byval sourcescreen as string)
// This routine will check to see which screen the user is clicking in from, and set
// a value for "sourcescreenid" unique to that screen
// "sourcescreen" is a piece of text past to this routine from the Sable button command set in the project.
if (sourcescreen = "TestScreen1")
sourcescreenid=1
end if
if (sourcescreen = "TestScreen2")
sourcescreenid=2
end if
// Finally, execute the move to the intended screen (the one that many screens can click into, but
// you want a single return button to return to the source screen)
call MoveToMainScreen("Intro.vnn")
end sub
sub returntoscreen()
// This routine interogates the global variable "sourcescreenid" and moves the user to the desired source
// screen.
dim nextscreen as string
if (sourcescreenid = 1)
nextscreen = "Test Screen 1.vnn"
end if
if (sourcescreenid = 2)
nextscreen = "Test Screen 2.vnn"
end if
call MoveToMainScreen(nextscreen)
end sub
-----------------------------------------------------
In sable, for the button to click to the common screen, use the XCommand "Execute Script" (eg. in my example, the command is Execute Script:SableScript.movetoscreen(TestScreen1)) making sure you enter the correct unique arguement for the source screen.
In Sable, for the return button, use the XCommand "Execute Script" (in my example; Execute Script:SableScript.returntoscreen()) Note there are no arguements to this routine.
I hope this is clear.
Lee
-
- Member
- Posts: 28
- Joined: Thu Aug 07, 2003 6:15 pm
-
- Member
- Posts: 28
- Joined: Thu Aug 07, 2003 6:15 pm
SPECIAL»ALIASSCREEN
Lee,
I installed the new version of Sable and I have the SCRIPTS folder in my project. Then I followed your instruction and created the following screen to be able to go to the "ANALYSIS" screen from four screens and come back to the them. But I still have a problem as I describe bellow.
global sourcescreenid as integer
sub movetoscreen(byval sourcescreen as string)
// This routine will check to see which screen the user is clicking in from, and set
// a value for "sourcescreenid" unique to that screen
// "sourcescreen" is a piece of text past to this routine from the Sable button command set in the project.
if (sourcescreen = "Simulate LT ST BF CT R and measurement")
sourcescreenid=1
end if
if (sourcescreen = "Simulate LT ST BF CT R and measurement 3 years")
sourcescreenid=2
end if
if (sourcescreen = "Simulate LT ST BF CT R and measurement 30 days")
sourcescreenid=3
end if
if (sourcescreen = "Simulate LT ST BF CT R M and Vision")
sourcescreenid=4
end if
// Finally, execute the move to the intended screen (the one that many screens can click into, but
// you want a single return button to return to the source screen)
call MoveToMainScreen("ANALYSIS.VNN")
end sub
sub returntoscreen()
// This routine interogates the global variable "sourcescreenid" and moves the user to the desired source
// screen.
dim nextscreen as string
if (sourcescreenid = 1)
nextscreen = "Simulate LT ST BF CT R and measurement.vnn"
end if
if (sourcescreenid = 2)
nextscreen = "Simulate LT ST BF CT R and measurement 3 years.vnn"
end if
if (sourcescreenid = 3)
nextscreen = "Simulate LT ST BF CT R and measurement 30 days.vnn"
end if
if (sourcescreenid = 4)
nextscreen = "Simulate LT ST BF CT R M and Vision.vnn"
end if
call MoveToMainScreen(nextscreen)
end sub
I tried to test the program by setting up a button in "Simulate LT ST BF CT R and measurement" screen. In the button I used these different forms of command. :
XCommnad  Execute Script:ExtProg.movetoscreen("Simulate LT ST BF CT R and measurement")
XCommnad  Execute Script:SableScript.movetoscreen("Simulate LT ST BF CT R and measurement")
XCommnad  Execute Script:movetoscreen("Simulate LT ST BF CT R and measurement")
XCommnad  Execute Script: SableScript.ExtProg.movetoscreen("Simulate LT ST BF CT R and measurement")
None of them moved us to the "ANALYSIS" screen that we intended to go.
Please let me know what is wrong with what I am doing.
Thanks,
Ali
[Edited on 20-8-2003 by mashayekhi]
I installed the new version of Sable and I have the SCRIPTS folder in my project. Then I followed your instruction and created the following screen to be able to go to the "ANALYSIS" screen from four screens and come back to the them. But I still have a problem as I describe bellow.
global sourcescreenid as integer
sub movetoscreen(byval sourcescreen as string)
// This routine will check to see which screen the user is clicking in from, and set
// a value for "sourcescreenid" unique to that screen
// "sourcescreen" is a piece of text past to this routine from the Sable button command set in the project.
if (sourcescreen = "Simulate LT ST BF CT R and measurement")
sourcescreenid=1
end if
if (sourcescreen = "Simulate LT ST BF CT R and measurement 3 years")
sourcescreenid=2
end if
if (sourcescreen = "Simulate LT ST BF CT R and measurement 30 days")
sourcescreenid=3
end if
if (sourcescreen = "Simulate LT ST BF CT R M and Vision")
sourcescreenid=4
end if
// Finally, execute the move to the intended screen (the one that many screens can click into, but
// you want a single return button to return to the source screen)
call MoveToMainScreen("ANALYSIS.VNN")
end sub
sub returntoscreen()
// This routine interogates the global variable "sourcescreenid" and moves the user to the desired source
// screen.
dim nextscreen as string
if (sourcescreenid = 1)
nextscreen = "Simulate LT ST BF CT R and measurement.vnn"
end if
if (sourcescreenid = 2)
nextscreen = "Simulate LT ST BF CT R and measurement 3 years.vnn"
end if
if (sourcescreenid = 3)
nextscreen = "Simulate LT ST BF CT R and measurement 30 days.vnn"
end if
if (sourcescreenid = 4)
nextscreen = "Simulate LT ST BF CT R M and Vision.vnn"
end if
call MoveToMainScreen(nextscreen)
end sub
I tried to test the program by setting up a button in "Simulate LT ST BF CT R and measurement" screen. In the button I used these different forms of command. :
XCommnad  Execute Script:ExtProg.movetoscreen("Simulate LT ST BF CT R and measurement")
XCommnad  Execute Script:SableScript.movetoscreen("Simulate LT ST BF CT R and measurement")
XCommnad  Execute Script:movetoscreen("Simulate LT ST BF CT R and measurement")
XCommnad  Execute Script: SableScript.ExtProg.movetoscreen("Simulate LT ST BF CT R and measurement")
None of them moved us to the "ANALYSIS" screen that we intended to go.
Please let me know what is wrong with what I am doing.
Thanks,
Ali
[Edited on 20-8-2003 by mashayekhi]
-
- Member
- Posts: 28
- Joined: Thu Aug 07, 2003 6:15 pm
-
- Member
- Posts: 28
- Joined: Thu Aug 07, 2003 6:15 pm
-
- Super Administrator
- Posts: 4573
- Joined: Wed Mar 05, 2003 3:10 am
Hello Ali,
Are you manually typing in the following commands?
XCommnad  Execute Script:ExtProg.movetoscreen("Simulate LT ST BF CT R and measurement")
XCommnad  Execute Script:SableScript.movetoscreen("Simulate LT ST BF CT R and measurement")
XCommnad  Execute Script:movetoscreen("Simulate LT ST BF CT R and measurement")
XCommnad  Execute Script: SableScript.ExtProg.movetoscreen("Simulate LT ST BF CT R and measurement")
If you have the script file loaded correctly, you should have a combo box where you can select the correct function. Are you getting these?
Tony.
Are you manually typing in the following commands?
XCommnad  Execute Script:ExtProg.movetoscreen("Simulate LT ST BF CT R and measurement")
XCommnad  Execute Script:SableScript.movetoscreen("Simulate LT ST BF CT R and measurement")
XCommnad  Execute Script:movetoscreen("Simulate LT ST BF CT R and measurement")
XCommnad  Execute Script: SableScript.ExtProg.movetoscreen("Simulate LT ST BF CT R and measurement")
If you have the script file loaded correctly, you should have a combo box where you can select the correct function. Are you getting these?
Tony.
-
- Member
- Posts: 28
- Joined: Thu Aug 07, 2003 6:15 pm
Lee,
I do not get the combo box. I have created the script file and saved it as ExtProg.vst in the SCRIPTS folder of the project. But after choosing the Xcommand and "Execute script" no combo box appears. May be th eproblem is ther. How can load my script correctly. I went to the work space and saw the file in the SCRIPTS folder. I right clicked on SCRIPT folder nothing came up to let me load the file if it is not loaded before.
I do not get the combo box. I have created the script file and saved it as ExtProg.vst in the SCRIPTS folder of the project. But after choosing the Xcommand and "Execute script" no combo box appears. May be th eproblem is ther. How can load my script correctly. I went to the work space and saw the file in the SCRIPTS folder. I right clicked on SCRIPT folder nothing came up to let me load the file if it is not loaded before.
-
- Member
- Posts: 28
- Joined: Thu Aug 07, 2003 6:15 pm
-
- Super Administrator
- Posts: 4573
- Joined: Wed Mar 05, 2003 3:10 am
Ali,Originally posted by mashayekhi
I tried all four without (") but none worked. Can you please send me an example of the Xcommand that has worked?
Thanks
Ali:(
the xcommand I sent in the original post works as I had to create it to test it.
Execute Script:SableScript.movetoscreen("TestScreen1")
The above is the exact command I have used today, testing the presence of the "" (which still works).
When you add an XCommand to a button, double-click on the right-hand-side (under "Commands") and a navigation button will appear to the far right. Click on this and you will get another dialog with a drop-down box (as mentioned by Tony). From here, select EXECUTE SCRIPT and click on the navigation button to the right of this command. This will give you the SCRIPT COMMAND dialog from which you can select the desired script to run.
Remember that if you change the script, you will need to reopen the project in order for Sable to reopen the script file.
Lee
[Edited on 20-8-2003 by Lee Jones]
-
- Member
- Posts: 28
- Joined: Thu Aug 07, 2003 6:15 pm