d("rma_date") = request.form("FormDate")
d("rma_phone") = request.form("FormPhone")
d("rma_orderno") = request.form("FormOrderNumber")
d("rma_email") = request.form("FormEmail")
d("rma_partno") = request.form("partno")
d("rma_comment") = request.form("comment")
d("rma_note") = request.form("note")
d("rma_failtype") = request.form("failtype")
''' from this
dim handleTypeArray
handleTypeArray = Split(request.form("handletype"), ",")
Dim counter
For counter = 0 To UBound(handleTypeArray)
if handleTypeArray(counter) <> " " then
d("rma_handletype") = handleTypeArray(counter)
end if
Next
''' to this
d("rma_exchanged_partno") = request.form("exchanged_partno")
d("rma_account_number") = request.form("account_number")
d("rma_reg_number") = request.form("reg_number")
d("rma_error_description") = request.form("error_description")
d("rma_vareno") = request.form("varenumer[]")
d("sent") = true
'SoapCheckRMA(d)
'd("rmano") = SoapCheckRMA(d)
'test
d("rmano") = "something else"
r = rendertemplate("templates\rma_new.done.html", d)
HandleRMANew=Translate(r, session("language"), "rma_new")
Should I refactor the code from the block from here to to here. Because I find myself too focusing in developing and create beautiful code. It takes too much time, since I should code more feature instead.
But I want a readable code so I can save bunch of time for me and another developers to work on this later. My goals of writing code is easy to read and maintain later. So what is the strategy in this case :
- Add a comment to explain what I do here
- Create a simple helper function to get the form value in one line like others above lines.