Raised This Month: $ Target: $400
 0% 

How to transfer a lot of options in "for" operator


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
groofshark
Member
Join Date: Jul 2013
Old 05-30-2015 , 04:47   Re: How to transfer a lot of options in "for" operator
Reply With Quote #8

Quote:
Originally Posted by Nextra View Post
You already have a lookup table that is indexed by your item numbers. If your code is more complex than the example you provided, you should always look towards crafting this type of setup, where you simply retrieve from an array index - it doesn't matter if it is of constant size or dynamic. If you have a case where you feel that a for loop is actually necessary, you need to update your example and show us.

Code:
if (g_options[id][iItem]) {    return MENU_DISABLED; }
That's for all menu. I want instead adding 20 if( g_options[id][iItem] ) just to make a loop and that loop to give on every "IF" - option and his number(iItem)

EDIT(sorry, double posting):
That's the example


I can't explain it better.

Last edited by groofshark; 05-30-2015 at 04:52.
groofshark is offline
 



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 -4. The time now is 18:42.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode