Post Reply 
Choose Funktion in an Choose Funktion
05-17-2015, 02:08 PM
Post: #1
Choose Funktion in an Choose Funktion
Hello all,

How can i create an choose function i a choose function?
Find all posts by this user
Quote this message in a reply
05-17-2015, 04:00 PM
Post: #2
RE: Choose Funktion in an Choose Funktion
Hello Heino!

Did you mean something like this?



EXPORT Prog()
BEGIN
LOCAL VARIABLE_01,VARIABLE_02;
CHOOSE(VARIABLE_01,"TITLE",{"OPTION_01","OPTION_02","OPTION_03"});
CASE
IF VARIABLE_01==1 THEN MSGBOX("COMANDS_01") END;
IF VARIABLE_01==2 THEN MSGBOX("COMANDS_02") END;
IF VARIABLE_01==3 THEN CHOOSE(VARIABLE_02,"TITLE",{"OPTION_04","OPTION_05","OPTION_06"});
CASE
IF VARIABLE_02==1 THEN MSGBOX("COMANDS_04") END;
IF VARIABLE_02==2 THEN MSGBOX("COMANDS_05") END;
IF VARIABLE_02==3 THEN MSGBOX("COMANDS_06") END;
DEFAULT
END;
END;
DEFAULT
END;
END;

Spybot.
Find all posts by this user
Quote this message in a reply
05-17-2015, 05:59 PM
Post: #3
RE: Choose Funktion in an Choose Funktion
Hello Spybot,

thanks for your answer. That´s a good solution, but I search for another one.
See Screen1.


Attached File(s) Thumbnail(s)
   
Find all posts by this user
Quote this message in a reply
05-17-2015, 07:10 PM
Post: #4
RE: Choose Funktion in an Choose Funktion
Where did you get the screenshot from?
I guess the code behind it has some hints...
Find all posts by this user
Quote this message in a reply
05-17-2015, 07:26 PM
Post: #5
RE: Choose Funktion in an Choose Funktion
(05-17-2015 07:10 PM)petaks01 Wrote:  Where did you get the screenshot from?
I guess the code behind it has some hints...

That looks like a system menu/sub menu and not a choose command. In so far I can tell we do not yet have the ability to create submenus in our programs.
Find all posts by this user
Quote this message in a reply
05-17-2015, 07:47 PM
Post: #6
RE: Choose Funktion in an Choose Funktion
Okay, you are right. But I have made my solution with Spybot's program.

Thank's all.

Heino
Find all posts by this user
Quote this message in a reply
05-17-2015, 07:54 PM
Post: #7
RE: Choose Funktion in an Choose Funktion
(05-17-2015 07:26 PM)kharpster Wrote:  
(05-17-2015 07:10 PM)petaks01 Wrote:  Where did you get the screenshot from?
I guess the code behind it has some hints...

That looks like a system menu/sub menu and not a choose command. In so far I can tell we do not yet have the ability to create submenus in our programs.

Sub menus can be created, but not in the cascaded style in the screenshot. I created a custom choose box popup menu with sub menus where the sub menu replaces the parent menu on the screen. I use it to consolidate some of my most used programs.
That isn't the cascaded style but probably the next best thing.

------------------------------------------------------------
lastunit:={0,0};

KEY K_Space()
BEGIN
local list1:={"Electrical Eng",
"Geometry","Deg2Rad",
"Rad2Deg",
"atan2","DTAG",
"Slope"};
local list2:={{"Parallel_Resistance",
"Coulomb","in"},
{"Area_circle",
"Vol_sphere",
"Area_cyl"}};
local c1,c2;
if lastunit(1) OR lastunit(2) then
c1:=lastunit(1); c2:=lastunit(2);
choose(c2,list1(c1),list2(c1));
else
c1:=0; c2:=0;
end;

if c2==0 then
repeat
choose(c1,"User Functions",list1);
if c1<3 then
choose(c2,list1(c1),list2(c1));
else

RETURN list1(c1);
end;
until c1==0 OR c2;
lastunit:={c1,c2};
end;

if c2 then
return(list2(c1,c2));
end;
END;
----------------------------------------------------------
This program is based on example that I believe Han posted a while back to a similar question that I had about nested popup menus.
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)