diff --git a/PROMS/DataLoader/Sections.cs b/PROMS/DataLoader/Sections.cs index 0fe47ab9..a31ec1ea 100644 --- a/PROMS/DataLoader/Sections.cs +++ b/PROMS/DataLoader/Sections.cs @@ -402,8 +402,13 @@ namespace DataLoader string s = dr["text"].ToString().PadRight(130, ' '); string rid = dr["recid"].ToString(); // RECID string num = s.Substring(85, 20).TrimEnd(); - string fmt = s.Substring(75, 8).TrimEnd(); - if (fmt == "") fmt = null; + string fmt = s.Substring(75, 8).TrimEnd(); // base format name + string ufmt = s.Substring(83, 2).TrimEnd(); // user format number (see TSectEditDlg::SetupWindow() PROMSNT\EXE\WINED\SECTEDIT.CPP) + // Build the format name if one was specified for this section. + if (fmt == "") + fmt = null; + else if (ufmt.Length == 2 && char.IsDigit(ufmt[0]) && char.IsDigit(ufmt[1])) // user format reference must be two digits + fmt = fmt.PadRight(8,' ') + ufmt; // append the user format reference bool ismulti = false; bool conv_caret = true;