CANT UNDERSTAND A SYNTAX IN VBSCRIPT

Royce Roy

Total Post:149

Points:1043
Posted by  Royce Roy
 1056  View(s)
Ratings:
Rate this:
Hi Guys,

I know its a really stupid question, but can anyone help me understanding these lines:

dim dmnth = array()
Redim dmnth(Rs_emp_count + 1, Rs_proj_count + 1, total_days + 1)
dmnth(emp_cnt, prj_cnt, 0) = pname & " (" & pid & ")"

Thanks
  1. Vijay Shukla

    Post:100

    Points:700
    Re: Cant understand a syntax in vbscript

    Hi,


    dim dmnth = array(); this sets dmth to the return value of the function array(); whatever that is. It is an unnecessary step in your program; unless array() does something useful aside from returning a value back.

    Redim dmnth(Rs_emp_count + 1, Rs_proj_count + 1, total_days + 1); this trashes the contents of dmth; replacing dmnth with a 3D array with sizes, for each dimension respectively, Rs_emp_count + 1, Rs_proj_count + 1 and total_days + 1. All elements are cleared.

    dmnth(emp_cnt, prj_cnt, 0) = pname & " (" & pid & ")" assigns pname & " (" & pid & ")" to the (emp_cnt, prj_cnt, 0) element of the array. Remember that arrays in VBScript are zero based; i.e. (0, 0, 0) is a valid element.

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!