How JustAnswer Works:

  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site.
    Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.

Ask Chris Baxter Your Own Question

Chris Baxter
Chris Baxter, Programming Tutor
Category: Programming
Satisfied Customers: 243
Experience:  Completed BSIT concentration Software Engineering, tutored other students and classmates in Java and VB.net, C++, and Obj C.
68869132
Type Your Programming Question Here...
Chris Baxter is online now
A new question is answered every 9 seconds

I am writing VB code to CreateLine function. How can I pass

Customer Question

Hello,
I am writing VB code to CreateLine function. How can I pass the value to
this script and create 2nd, 3rd line, etc. (depends on how many line in Invoice)?
calc.AddLine(CreateLine(50, "1", "1", "EA"))
calc.AddLine(CreateLine(100, "2", "1", "EA"))
Private Function CreateLine(ByVal grossAmount As Integer, ByVal LineNumber As String, ByVal Quantity As Integer, ByVal UOM As String) As ILineInfo
Dim Line As LineInfo
Dim inv As InvoiceItem
Line = New LineInfo
inv = New InvoiceItem
Line.GrossAmount = Convert.ToString(inv.extended_price)
Line.LineNumber = inv.line_number '(will have multiple lines)
I am new VB programer and thank you for the help.
Submitted: 10 months ago.
Category: Programming
Expert:  Ingo U replied 10 months ago.

Hello,
Sometimes pasting formatted data directly into this site doesn't
render as you'd expect, and can become difficult to read.
I'm not sure I got all the information correctly and completely.
Could you please upload any files related to this project to wikisend.com
(or a file sharing site of your choice) so I may have a look?
If there are multiple files, it's easiest to put them in a compressed (zipped)
folder and upload just that one item.

Thanks,
Ingo U

PS If you're not familiar with wikisend, it's easy and free:
Go to www.wikisend.com and upload the file there (no need to sign up).
You will then get a page that has the File ID and Download Link.
Copy either the File ID or the Download Link and come back here and paste it in your reply.

Customer: replied 10 months ago.
Hello,I have upload the file ID 976634
http://wikisend.com/download/976634/KimVB.txt
Expert:  Ingo U replied 10 months ago.

I'm sorry,
After reviewing the question, I regret that I won't be able to assist you at this time.

I am opting out and opening the question up to other professionals here who may be able to help.

Regards,
Ingo U

Customer: replied 10 months ago.
What I have now for the line items is hard code, but is not want I want. The values need to be passed through InvoiceItem
calc.AddLine(CreateLine(50, "1", "1", "EA"))
calc.AddLine(CreateLine(100, "2", "1", "EA"))
Expert:  Chris Baxter replied 10 months ago.

Have you tried to loop this?

ex

For each line in lineArray()

<to do code here>

Next line

where your to do code is roughly:

dim lineIncrement as Integer = 50

dim linenumber as String = Line.LineNumber?

calc.AddLine(CreateLine(lineIncrement, lineNumber, "1", "EA"))

lineIncrement = lineIncrement + 50

etc....