B
Brian Parker
I am beginning to work with VB2005.NET and I'm getting some problems
with string formatting converting an application from VB6.
VB6 code:-
sTradeDate = Format(pArray(4,i Record), "mmddyy")
pArray is a variant array containing a date string at pArray(4,
iRecord) in the format "yyyy/mm/dd"
The format function call changes that value into an mmddyy string no
problem, which is what I need it to do.
After running the upgrade wizard I get a converted line like:-
TradeDate.Value = VB6.Format(pArray(4, Record), "mmddyy")
Which also works. Note the TradeDate value is converted to a
VB6.FixedLengthString by the wizard and the variant array pArray
becomes an object.
Trying manually to make this more fully VB.NET-like I tried:-
TradeDate.Value = pArray(4, Record).ToString("mmddyy")
but I get a "Conversion from string "mmddyy" to type 'Integer' is not
valid."
I rather suspect that I have mis-understood something here. Any
assistance would be most gratefully received.
Thanks a lot,
Brian
with string formatting converting an application from VB6.
VB6 code:-
sTradeDate = Format(pArray(4,i Record), "mmddyy")
pArray is a variant array containing a date string at pArray(4,
iRecord) in the format "yyyy/mm/dd"
The format function call changes that value into an mmddyy string no
problem, which is what I need it to do.
After running the upgrade wizard I get a converted line like:-
TradeDate.Value = VB6.Format(pArray(4, Record), "mmddyy")
Which also works. Note the TradeDate value is converted to a
VB6.FixedLengthString by the wizard and the variant array pArray
becomes an object.
Trying manually to make this more fully VB.NET-like I tried:-
TradeDate.Value = pArray(4, Record).ToString("mmddyy")
but I get a "Conversion from string "mmddyy" to type 'Integer' is not
valid."
I rather suspect that I have mis-understood something here. Any
assistance would be most gratefully received.
Thanks a lot,
Brian