Arrays in HLSL need to have a length that is static at compile time. So in other words..
// You can do this...
static const uint ArraySize = 5
float Array[ArraySize];
// Or you can do this...
#define ArraySize 5
float Array[ArraySize];
// But you can't do this
uint ArraySize = 5;
float Array[ArraySize];
Usually what you do, is you define the array to some maximum size and then set another variable to a value representing how many values to actually use from the array. Like this:
static const uint MaxValues = 5;
float Values[MaxValues];
uint NumValuesToUse;
Just be careful...depending on the shader profile you use the compiler's ability to represent loops in shader assembly may be limited.