Raised This Month: $ Target: $400
 0% 

Enums & 2D array


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
eyal282
Veteran Member
Join Date: Aug 2011
Old 07-15-2017 , 08:42   Re: Enums & 2D array
Reply With Quote #2

Quote:
Originally Posted by Natsheh View Post
PHP Code:
enum COLORS_VAR
{
    
COLOR_NAME[32],
    
Float:COLOR_FVALUE[3],
    
Float:COLOR_FRENDERING
}

new const 
COLORS_DATA[][COLORS_VAR] = {
    { 
"Red", {200.0000.0000.0}, 100.0 },
    { 
"Red Orange", {255.0083.0073.0}, 135.0 },
    { 
"Orange", {255.0117.0056.0}, 140.0 }, 
    { 
"Yellow Orange", {255.0174.0066.0}, 120.0 }, 
    { 
"Peach", {255.0207.0171.0}, 140.0 }, 
    { 
"Yellow", {252.0232.0131.0}, 125.0 },
    { 
"Dark Lemon Lime", { 135.0200.0020.0 }, 115.0 },
    { 
"Lemon Yellow", {254.0254.0034.0}, 100.0 },
    { 
"Jungle Green", {059.0176.0143.0}, 125.0 },
    { 
"Yellow Green", {197.0227.0132.0}, 135.0 },
    { 
"Light Sea Green", {050.0175.0070.0}, 130.0 },
    { 
"Green", {000.0150.0000.0}, 100.0 },
    { 
"Aquamarine", {120.0219.0226.0}, 125.0 },
    { 
"Baby Blue", {135.0206.0235.0}, 150.0 },
    { 
"Charged Blue", {055.0015.0220.0}, 125.0 }, 
    { 
"Sky Blue", {128.0218.0235.0}, 090.0 },
    { 
"Blue", {000.0000.0255.0}, 075.0 },
    { 
"Violet", {146.0110.0174.0}, 175.0 },
    { 
"Dogwood Rose", {220.0050.0200.0}, 135.0 },
    { 
"Hot Pink", {255.0105.0180.0}, 150.0 },
    { 
"Magenta", {246.0100.0175.0}, 175.0 },
    { 
"Mahogany", {205.0074.0076.0}, 140.0 },
    { 
"Tan", {250.0167.0108.0}, 140.0 },
    { 
"Light Brown", {234.0126.0093.0}, 140.0 },
    { 
"Brown", {180.0103.0077.0}, 165.0 },
    { 
"Gray", {149.0145.0140.0}, 175.0 },
    { 
"Black", {000.0000.0000.0}, 125.0 },
    { 
"White", {255.0255.0255.0}, 125.0 }
}

public 
call_color_menu()
{
      
display_menu(id"MENU_ID""TITLE"COLORS_DATA[][COLOR_NAME], etc....) // this is line 512....
}

display_menu(id, const menu_name[], const title[], const menu[][], const msize, const colornum[3]="\r", const ikeys=MENU_KEYSmaxperpage=5page=0)
{
      
// code etc....

i get fail to compile....

error log:-

Code:
Error: Invalid expression, assumed zero on line 521

isnt this a 2D array >> COLORS_DATA[][COLOR_NAME] <<

Unsure about the rest of the code but it doesn't make sense. You are inputting something probably problematic. Try inputting in your call_color_menu COLORS_VAR ( the enumeration )
eyal282 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 23:09.


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