Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 12-29-2006, 03:25 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
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?
__________________

Last edited by Chompy; 12-29-2006 at 04:25 PM..
Reply With Quote
  #2  
Old 12-29-2006, 04:04 PM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
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.
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #3  
Old 12-29-2006, 04:06 PM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
Quote:
Originally Posted by xXziroXx View Post
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;
  }

__________________
Skyld
Reply With Quote
  #4  
Old 12-29-2006, 04:09 PM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Quote:
Originally Posted by Skyld View Post
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.
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 07:00 PM.


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