View previous topic :: View next topic |
Author |
Message |
bknight2602 Grandmaster Cheater
Reputation: 0
Joined: 08 Oct 2012 Posts: 582
|
Posted: Fri Feb 24, 2023 5:07 pm Post subject: For loop to clear all check boxes |
|
|
I'm trying to write a bit of code to check if any of the boxes to the left of each record are checked and if so then unchecked it. I'm having difficulty. The code is exectuded when a button is pressed
Code: |
clear_all_check_boxes.onClick = function (sender)
AL = getAddressList();
for i = 1, AL.count do
mr = AL.CheckedStatus
if mr.CheckedStatus = 'true' then
mr.CheckedStatus = 'false';
end;--if mr(i).CheckedStatus = true then
end;--for i = 1, AL.count do
end;--function (sender)
|
|
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 467
Joined: 09 May 2003 Posts: 25704 Location: The netherlands
|
Posted: Fri Feb 24, 2023 5:17 pm Post subject: |
|
|
are you sure you don't want to do AddressList.disableAllWithoutExecute() ?
anyhow, best do a reverse loop
Code: |
for i=AddressList.Count-1,0,-1 do
AddressList[i].Active=false
end
|
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
 |
bknight2602 Grandmaster Cheater
Reputation: 0
Joined: 08 Oct 2012 Posts: 582
|
Posted: Fri Feb 24, 2023 6:37 pm Post subject: |
|
|
Dark Byte wrote: | are you sure you don't want to do AddressList.disableAllWithoutExecute() ?
anyhow, best do a reverse loop
Code: |
for i=AddressList.Count-1,0,-1 do
AddressList[i].Active=false
end
|
|
Why the reverse loop? If the "AddressList.disableAllWithoutExecute()" would work without the for loop then that would be good. I'll try that first. Thanks
ETA: AddressList.disableAllWithoutExecute() didn't work, but the the other one did work.
If I had a memory record that had been set from code such as
dn_class_points4_address and If I wanted to make that record "active", would the code be
dn_class_points4_address.Active=true?
|
|
Back to top |
|
 |
LeFiXER Grandmaster Cheater Supreme
Reputation: 20
Joined: 02 Sep 2011 Posts: 1066 Location: 0x90
|
Posted: Sat Feb 25, 2023 1:08 am Post subject: |
|
|
bknight2602 wrote: |
...
If I had a memory record that had been set from code such as
dn_class_points4_address and If I wanted to make that record "active", would the code be
dn_class_points4_address.Active=true? |
You can activate the memory record like so:
Code: |
AddressList['dn_class_points4_address'].Active = true
|
|
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 467
Joined: 09 May 2003 Posts: 25704 Location: The netherlands
|
Posted: Sat Feb 25, 2023 3:14 am Post subject: |
|
|
reverse so all children get deactivated before the parent, so any autodeactivating cide or destruction of records won't affect the index
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
 |
bknight2602 Grandmaster Cheater
Reputation: 0
Joined: 08 Oct 2012 Posts: 582
|
Posted: Sat Feb 25, 2023 7:43 am Post subject: |
|
|
Ok, sounds reasonable.
|
|
Back to top |
|
 |
|