VB2005 In my app I present to the user an option to customize the name of the file that gets produced. The format string the program reads is something like
"yyyyMMdd-%1-%2-%3-%4" which the user can customize to his liking.
in this case the format of the date is yyyyMMdd and the %1 is the trip number like 1000P, %2 is the origin code like PTTTT, %3 is the destination code like PHYUD, and %4 is a secondary stop code like YYYY123.
Im having problems taking the actual data and formatting into the custom string. I believe its the date format that Im getting stuck on. So far I have
sOut = txtFormatPattern.Text
sOut = sOut.Replace("%1", "1000P")
sOut = sOut.Replace("%2", "PTTTT")
sOut = sOut.Replace("%3", "PHYUD")
sOut = sOut.Replace("%4", "YYYY123")
sOut = myDate.ToString(sOut) 'date is July 01, 2007
the output is "20070701-#1000P-PTTTTP12YUD (YYYY123)" The problem obviously here is my last conversion. the string contains key characters that denote a part of the date specifically in PHYUD. So my question is how can I give my user the flexibility to format the output as they wish and then convert that properly?
agp