Hi Colin,
Colin Haig wrote:Hi Carlos
Thanks for your reply but with some great help from Daniel Garcia Gil I was able to resolve the problem.
glad to hear that you solved the problem. I would be nice to post the answer, usually other coleagues can also find the solution and take advantage of it, specially with the new features of Harbour. In this particular case, I agree with James, JSON and stuff like that related to the internet and services are where thing are moving to.
Anyway, the solutions you posted works slightly differently from what was asked in the original post, that was ["field"] in first term, then [index]. The code you posted is [index]["field"], isn't it? Let me suggest sth:
In Harbour you can write code of hashes straight in your code like we used to do with arrays, but using the => operator, so the whole inner loop block can be changed to something more readable like
Code: Select all
hUser2 := { "Description" => aData[i,1] ;
, "Total" => aData[i,2] ;
, "Account" => { "UID" => aData[i,3] } ;
, "TaxCode" => { "UID" => cClTaxUid } ;
, "FreightTaxCode" => { "UID" => cClTaxUid } ;
}
No functions call, just operators. Hash function names have names hard to remember (at least for me
)!
Regards