corrected problem with "[]" String Delimiters conflict with array names of reserved words (next, while, etc.) Please note to check i_INDEX_STATE before a "BEGIN 0;" as in the followings: if( iINDEX_STATE ) BEGIN INDEX; else BEGIN 0;