Array index out of bounds?

Hi Notes gurus,

I have written the following formula, I am getting ‘Array index out of bounds’ error.

NID := @Text(NetworkID);

NList := @Text(NetworkList);

NRoles := @Text(NetworkRoles);

Output := “”;

n := 0;

Result := “”;

FIELD Combined:=“”;

@While(n <= @Elements(NID);

Output := NList[n] + “~” + NRoles[n] + “~” +NID[n];

Result := @Text(Result) + “~” + @Text(Output);****I am getting error here.

n := n + 1

);

FIELD Combined:= Result;

@Command([ToolsRunMacro];“(SortNetList)”) ;

@Command([FileSave]);

@Command([FileCloseWindow])

Please let me if I am missing anything.

Thanks in advance.

Subject: Field indices start at 1 in @Formula language.