Author Topic: creating a control now puts the number of that control into it's variable  (Read 1650 times)

0 Members and 1 Guest are viewing this topic.

Jean

  • Administrator
  • Hero Member
  • *****
  • Posts: 1313
    • View Profile
You can now do this

Code: [Select]
button(0, 0, "hi", NULL);
command(BUTTON, buttonnumber, 0, 0); ` operate on the previously made button

Previously you had to do:

Code: [Select]
int i = button(0, 0, "hi", NULL);
command(BUTTON, i, 0, 0); ` operate on the previously made button

In stead of
Code: [Select]
menu(4, "Show Radix Lines", go);
menu(4, "Show Radix Planets", go);
menu(4, "Show House Lines", go);
command(MENU, 4, AUTOCHECK, 1); 
command(MENU, 5, AUTOCHECK, 1); 
command(MENU, 6, AUTOCHECK, 1);

It's easier to do this

Code: [Select]
menu(4, "Show Radix Lines", go);
command(MENU, menunumber, AUTOCHECK, 1); 
menu(4, "Show Radix Planets", go);
command(MENU, menunumber, AUTOCHECK, 1); 
menu(4, "Show House Lines", go);
command(MENU, menunumber, AUTOCHECK, 1);

In the last example you can now  delete / add / change the order of the menu()'s without having to change the numbers for command().

This applies to: buttonnumber, scrollnumber, editnumber, updownnumber and menunumber;
Greetings from Groningen Netherlands.