My simulation aborts with the error message: List position (x) is out-of-range. What does the error message mean?
My simulation aborts with the error message: List position (x) is out-of-range. What does the error message mean?
OPNET's list package indexes list elements starting at zero similar to the array indexing scheme defined by C. This means that if there are N elements in a list (created using the op_prg_list package), then the valid values for the second argument of op_prg_list_access i.e. pos_index, range from zero through N - 1. As good programming practice, it is recommended that you use the op_prg_list_size Kernel Procedure(KP) to determine the number of elements in a list before using op_prg_list_access to access elements in the list. An example scenario is shown below:list_size = op_prg_list_size (your_list_ptr);for (i = 0; i < list_size; i++) { list_elem_ptr = (list_elem_datatype *) op_prg_list_access (your_list_ptr, i); /* ...the rest of your code here. */} For detailed information on OPNET list related API please refer to Online documentation->Simulation Kernel->Programming(Prg) Package.
DES Kernel->Other,Logs and Errors