I'm testing Tangible Solution now (it's not free)
Tangible Source Converter
And he will add a class helper. But outside his result looks great.
Java: (original)
public class PackVariableArrays { private ClassError myerror=new ClassError(); public VariableArrays unpack(String txt) { VariableArrays pc = new VariableArrays(); Variable lc; txt=txt.replace("\r\n","\n"); setMyerror(new ClassError()); if (txt==null) { lc=new Variable(); lc.name="ERV-5: Empty values"; pc.addItem(lc); return pc; } String[] linecode = txt.split(ClassUtil.SEPARATOR2); int blen = 0; int tmpint = 0; int numelement = 9999;
C # (conversion)
public class PackVariableArrays { private ClassError myerror =new ClassError(); public virtual VariableArrays unpack(string txt) { VariableArrays pc = new VariableArrays(); Variable lc; txt=txt.Replace("\r\n","\n"); Myerror = new ClassError(); if (txt==null) { lc=new Variable(); lc.name="ERV-5: Empty values"; pc.addItem(lc); return pc; } string[] linecode = StringHelperClass.StringSplit(txt, ClassUtil.SEPARATOR2, true); int blen = 0; int tmpint = 0; int numelement = 9999;
This is a simple case, but it works great. However, as I said before, it uses the class helper (StringHelperClass.StringSplit), which is good but not needed. Beyond this, the result code is pretty clear.
magallanes Jan 29 '12 at 16:24 2012-01-29 16:24
source share