Help - Search - Members - Calendar
Full Version: Problems with brackets in some code
Hydrogenaudio Forums > Hosted Forums > foobar2000 > General - (fb2k)
Tvk
Could someone look through this code and correct the brackets? I basically want it to be like this: If the global isAlbum is present. I want the top, middle, bottom, left and rickt borders to display. If the global is not present, I don't want the middle and right border to be displayed. I want alternating background when the isAlbum tag is not present.

CODE
$if($get_global(isAlbum),

// Middle border
$ifequal(%tracknumber%,4,
$set_style(frame-bottom,1,$get_global(cFrmStd))
,)

// right border
$ifgreater(%tracknumber%,0,
$set_style(frame-right,1,$get_global(cFrmStd))
,)
)

// Top & bottom border
$ifequal(%tracknumber%,1,
$set_style(frame-top,1,$get_global(cFrmStd)),
$if($stricmp(%playlist_number%,%_playlist_total%),
$set_style(frame-bottom,1,$get_global(cFrmStd))
,))

// left border
$ifgreater(%tracknumber%,0,
$set_style(frame-left,1,$get_global(cFrmStd))
,)

$set_style(back
,$ifequal($mod(%_playlist_number%,2),0,$get_global(cBgStd),$get_global(cBgAlt))
,$get_global(cBgSel))
)
fluffy
THis should work.


CODE
$if($get_global(isAlbum),

// Middle border
$ifequal(%tracknumber%,4,
$set_style(frame-bottom,1,$get_global(cFrmStd)))

// right border
$ifgreater(%tracknumber%,0,
$set_style(frame-right,1,$get_global(cFrmStd)))


// Top & bottom border
$ifequal(%tracknumber%,1,
$set_style(frame-top,1,$get_global(cFrmStd)),
$if($stricmp(%playlist_number%,%_playlist_total%),
$set_style(frame-bottom,1,$get_global(cFrmStd))))

// left border
$ifgreater(%tracknumber%,0,
$set_style(frame-left,1,$get_global(cFrmStd))),

$set_style(back
,$ifequal($mod(%_playlist_number%,2),0,$get_global(cBgStd),$get_global(cBgAlt))
,$get_global(cBgSel)))



ps: you should get a text editor with syntax highlighting, I use notepad++, and it show me which "(" connects with which ")".
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.