Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   GuiRadioCtrl, fast check; (https://forums.graalonline.com/forums/showthread.php?t=71094)

Chompy 12-29-2006 03:25 PM

GuiRadioCtrl, fast check;
 
Well, I am using a few GuiRadioCtrl ( actually 6), but, is there a way to see if some of them are checked? ( groupnum = 1)

Is there a faster way then doing like

PHP Code:

if ( ( @ Radio_Button0).checked || ( @ Radio_Button1).checked)
{
 ...
// just an example, having a long if statement. 

Is there a faster way?

xXziroXx 12-29-2006 04:04 PM

PHP Code:

for (0numberofradiobuttons++) {
  if ((
"Radio_Button" i).checked == truetemp.checked ++;
}
if (
temp.checked == numberofradiobuttons) {
  
// all buttons are checked!


Just an example on how to check if all of them are checked.

Skyld 12-29-2006 04:06 PM

Quote:

Originally Posted by xXziroXx (Post 1258404)
PHP Code:

for (0numberofradiobuttons++) {
  if ((
"Radio_Button" i).checked == truetemp.checked ++;
}
if (
temp.checked == numberofradiobuttons) {
  
// all buttons are checked!


Just an example on how to check if all of them are checked.

Radio buttons are only supposed to allow one to be selected from a group.

This might be more accurate:
PHP Code:

temp.buttons = {"Radio_Button1""Radio_Button2""Radio_Button3"};

for (
temp.buttontemp.buttons)
{
  if ((@ 
temp.button).checked)
  {
    
// This is the checked button, so do whatever and stop the loop
    
break;
  }



xXziroXx 12-29-2006 04:09 PM

Quote:

Originally Posted by Skyld (Post 1258405)
Radio buttons are only supposed to allow one to be selected from a group.

This might be more accurate:
PHP Code:

temp.buttons = {"Radio_Button1""Radio_Button2""Radio_Button3"};

for (
temp.buttontemp.buttons)
{
  if ((@ 
temp.button).checked)
  {
    
// This is the checked button, so do whatever and stop the loop
    
break;
  }



Oh yeah, long time since I last used them.


All times are GMT +2. The time now is 07:44 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.