error message at runtime [modified] .... resolved
-
when running application when program hits this code I get this error.
For y As Integer = 0 To frmtodayscafe.count For x As Integer = 2 To 12 writeline1(x) = filename(y) + vbTab + frmtodayscafe.totalitemquantity(y) + vbTab + FormatCurrency(filename1(y)) + vbTab + vbTab + FormatCurrency(frmtodayscafe.cost(y)) Next Next
cheeseburger is assign to filename(y) which is declared as a string array filename1(y) is a numeric value cost of the cheeseburger. writeline1(x) is also a string array. by changing the code to the following:
writeline(x) = filename(y) + vbTab + format(frmtodayscafe.totalitemquantity(y)) + vbTab + FormatCurrency(filename1(y)) + vbTab + vbTab + FormatCurrency(frmtodayscafe.cost(y))
modified on Monday, March 8, 2010 12:30 PM
-
when running application when program hits this code I get this error.
For y As Integer = 0 To frmtodayscafe.count For x As Integer = 2 To 12 writeline1(x) = filename(y) + vbTab + frmtodayscafe.totalitemquantity(y) + vbTab + FormatCurrency(filename1(y)) + vbTab + vbTab + FormatCurrency(frmtodayscafe.cost(y)) Next Next
cheeseburger is assign to filename(y) which is declared as a string array filename1(y) is a numeric value cost of the cheeseburger. writeline1(x) is also a string array. by changing the code to the following:
writeline(x) = filename(y) + vbTab + format(frmtodayscafe.totalitemquantity(y)) + vbTab + FormatCurrency(filename1(y)) + vbTab + vbTab + FormatCurrency(frmtodayscafe.cost(y))
modified on Monday, March 8, 2010 12:30 PM
-
Where come from the value "cheeseburger"? Which variable hold that value? Are you trying to do a "FormatCurrency" on that value?
cheeseburger is a string loaded from a file .... I am trying to write the string to a concatenated string to include qty, pricing, and total pricing. it should say on the string cheeseburger 1 $3.00 $3.00
-
cheeseburger is a string loaded from a file .... I am trying to write the string to a concatenated string to include qty, pricing, and total pricing. it should say on the string cheeseburger 1 $3.00 $3.00
-
wireline1 is a string array
-
when running application when program hits this code I get this error.
For y As Integer = 0 To frmtodayscafe.count For x As Integer = 2 To 12 writeline1(x) = filename(y) + vbTab + frmtodayscafe.totalitemquantity(y) + vbTab + FormatCurrency(filename1(y)) + vbTab + vbTab + FormatCurrency(frmtodayscafe.cost(y)) Next Next
cheeseburger is assign to filename(y) which is declared as a string array filename1(y) is a numeric value cost of the cheeseburger. writeline1(x) is also a string array. by changing the code to the following:
writeline(x) = filename(y) + vbTab + format(frmtodayscafe.totalitemquantity(y)) + vbTab + FormatCurrency(filename1(y)) + vbTab + vbTab + FormatCurrency(frmtodayscafe.cost(y))
modified on Monday, March 8, 2010 12:30 PM
-
You are doing a FormatCurrency on a string value of "Cheeseburger". I know of few countries where cheeseburgers are legal tender. You may want to try the amount (double) rather than the file name (string).
filename(0) = cheeseburger filename1(0) = 5.00 filename1(0) is being formatted to currency by not filename(0) cheeseburger is not being formatted as double.
-
when running application when program hits this code I get this error.
For y As Integer = 0 To frmtodayscafe.count For x As Integer = 2 To 12 writeline1(x) = filename(y) + vbTab + frmtodayscafe.totalitemquantity(y) + vbTab + FormatCurrency(filename1(y)) + vbTab + vbTab + FormatCurrency(frmtodayscafe.cost(y)) Next Next
cheeseburger is assign to filename(y) which is declared as a string array filename1(y) is a numeric value cost of the cheeseburger. writeline1(x) is also a string array. by changing the code to the following:
writeline(x) = filename(y) + vbTab + format(frmtodayscafe.totalitemquantity(y)) + vbTab + FormatCurrency(filename1(y)) + vbTab + vbTab + FormatCurrency(frmtodayscafe.cost(y))
modified on Monday, March 8, 2010 12:30 PM
by changing the code to the following has resolved issues. there are no more errors at runtime.
writeline(x) = filename(y) + vbTab + format(frmtodayscafe.totalitemquantity(y)) + vbTab + FormatCurrency(filename1(y)) + vbTab + vbTab + FormatCurrency(frmtodayscafe.cost(y))