Record toString method
This may be one of my favorite shortcuts I've created. For logging or debug it will give you the entire contents of any record in a string. Just like the Java toString class method.Example
The output looks like this:
- Local Record &rec = CreateRecord(Record.ADM_APPL_PROG);
- rem populate record with some values;
- MessageBox(0, "", 0, 0, " To String function : %1 ", recToString(&rec));
To String function : EARLY_FA_OFFER[abc123,1111,22,12345678,33,2014-11-05,1,4444,55.5]
Function
- Function recToString(&R) Returns string;
- Local number &f;
- Local string &txt = &R.name | "[";
- For &f = 1 To &R.FieldCount
- If &f > 1 Then
- &txt = &txt | ","
- End-If;
- &txt = &txt | &R.getfield(&f).value;
- End-For;
- Return &txt | "]";
- End-Function;