Results 1 to 17 of 17

Thread: VB6 (Punctuation)

  1. #1

    Thread Starter
    Member
    Join Date
    Oct 2001
    Posts
    49

    Cool VB6 (Punctuation)

    Hello everybody, I have a problem and I need you Guys to help me Solve it, I am doing a program which required the use of Punctuation OR spacing. The Place Pizza delivery company, we suppose to take pizza orders for delivery, calculate the Total due for the Pizza, and display the order, address, and total due for the pizza in a single output When an order is taken, the last name and street address(street number, streetname, and street/avenue) are each entered into their out textbox. the list of items to be on the pizza is entered, placing a comma between each item in asingle txtbox the cost of a pizza are based upon the size and number of items, Small $5, Medium $7, Large$9, and each additional Items is 75 cents each. If I Type in an address such as 6767 weST avENue My Statement will output a line such as:
    A large pizza with 4 items is to be delivered to 6767 West Avenue at a cost of $12.00
    also output the address with the first letter Capitalized, and one space between the number, name, and street type. please can any body help me with the punctuation and output in a single output line. Thank you so much
    Smilies are ON

  2. #2
    AutoBot
    Guest
    Please if your going to ask a question post it in a mannor that it can be clearly Understood.

  3. #3
    Frenzied Member
    Join Date
    Jan 2001
    Posts
    1,374
    The address issue can be solved by:

    Dim strAddress As String

    strAddress = Text1.Text

    strAddress = StrConv(strAddress, vbProperCase)


    6767 weST avENue will be converted to 6767 West Avenue

  4. #4
    PowerPoster beachbum's Avatar
    Join Date
    Jul 2001
    Location
    Wollongong, NSW, Australia
    Posts
    2,274

    Re: VB6 (Punctuation)

    Proof that dicky fonts make it too much trouble to read and answer the question.
    Stuart Laidlaw
    Brightspark Financial Software
    http://www.gstsmartbook.com

  5. #5

    Thread Starter
    Member
    Join Date
    Oct 2001
    Posts
    49
    Originally posted by AutoBot
    Please if your going to ask a question post it in a mannor that it can be clearly Understood.
    Hi, you don't need to criticized what I send. all I did that I put all the information there, hoping this information would help, plus I Indicate what I need very clearl , I want the address to be output in a single line, by using Punctuation, any way that was very sweet of you that you tried.
    Smilies are ON

  6. #6

    Thread Starter
    Member
    Join Date
    Oct 2001
    Posts
    49
    Originally posted by robertx
    The address issue can be solved by:

    Dim strAddress As String

    strAddress = Text1.Text

    strAddress = StrConv(strAddress, vbProperCase)


    6767 weST avENue will be converted to 6767 West Avenue
    Hi, this not the Code I need , but thank you very much for trying
    Smilies are ON

  7. #7
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649
    If you want to know how to calculate the cost of the pizza then use code simular as the following, assuming the textbox you enter the items in is named txtItems
    VB Code:
    1. Dim dCost As Double
    2. dCost = (UBound(Split(txtItems.Text, ",")) + 1) * .75
    3. 'add code here to add $5, $7 or $9 to dCost depending on the size.
    4. MsgBox "The cost for the pizza is " & Format(dCost, "$##0.00")
    Best regards

  8. #8
    DaoK
    Guest
    dCost = (UBound(Split(txtItems.Text, ",")) + 1) * .75


    Why Ubound ? Ubound is used for Array variable...and you didnt declare any Array ?

  9. #9
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923
    Originally posted by DaoK
    dCost = (UBound(Split(txtItems.Text, ",")) + 1) * .75


    Why Ubound ? Ubound is used for Array variable...and you didnt declare any Array ?
    Split returns an array

  10. #10
    DaoK
    Guest
    forget

  11. #11
    AutoBot
    Guest
    I wasn't being critical of your post, I simply saying it would have been easier to read and understand if you would have posted the question in a single font size, wasn't trying to offend you

  12. #12
    Addicted Member Rikk's Avatar
    Join Date
    Nov 2001
    Location
    Atlanta
    Posts
    131
    Do you need help with ALL the parts?? Or just the street address part? I think the reply from robertx will solve your upper case-lower case issue.
    Rikk =\=
    Starcraft, Protoss Scout Driver!

  13. #13

    Thread Starter
    Member
    Join Date
    Oct 2001
    Posts
    49
    Hello, As a matter of fact yes I need help with all, the address, the cost and the Items, I know how to solve Upper and Lower case , but Idon't know how to Output in one ,Single Statement Such as: A large pizza with 4 items is to be delivered to 6767 West Avenue at a cost of $12.00 also I don't know how to make a list of Items to be on the pizza , placing comma between each item in a single txt box I used 4 txtbox to input the street name, street number, street type, but for the Items and items number I used inputbox, and for the size of the pizza I used option button. I hop this give you an insight what I want, I really appreciate your help, thank you so much
    Smilies are ON

  14. #14
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649
    Jamel, as it has been posted before; Stop using different font and sizes in your posts!!!

    To answer your question, first of all I allready showed how you can calculate the cost of the pizza, just add the size cost depending on what option button that's set (check the Value property).

    Now if you have the cost in a variable named dCost (or whatever) and your textboxes are named (in the following example)
    txtSteet
    txtAddress
    txtAvenue
    VB Code:
    1. Dim dCost As Double
    2. Dim sSize As String ' set this to a value of small, medium, or large
    3. depending on which option button is selected
    4. Dim sOutput As String 'we use this string to contain the output
    5. ' Insert the cost calculation here as showed earlier
    6. ' Set the sSize variable to a value of SMALL, MEDIUM or LARGE here depending on the value of the option buttons
    7. sOutput = "A " & sSize " pizza with " & UBound(Split(txtItems.Text, ",")) + 1 & _
    8.   " items to be delivered to " & txtAddress.Text & " " & txtSteet.Text & _
    9.   " " & txtAvenue.Text & " at a cost of $" & _
    10.   Format(dCost, "###0.00")
    11. MsgBox sOutput 'or asign it sOutput to a TextBox or whatever you want
    I hope this make any sense to you.

    Best regards

  15. #15

    Thread Starter
    Member
    Join Date
    Oct 2001
    Posts
    49
    Hello Andersson, thank you so much for the code, I used it, and its perfect. Thank you again
    Smilies are ON

  16. #16

    Thread Starter
    Member
    Join Date
    Oct 2001
    Posts
    49
    Originally posted by AutoBot
    I wasn't being critical of your post, I simply saying it would have been easier to read and understand if you would have posted the question in a single font size, wasn't trying to offend you

    Hello again, I just want to tell you that you are right, you are not the only one who Say it. I agree this is an awfull post, and I'm Sorry.
    Smilies are ON

  17. #17

    Thread Starter
    Member
    Join Date
    Oct 2001
    Posts
    49
    Originally posted by Jamal

    Hi, this not the Code I need , but thank you very much for trying
    Hi, I have to come back to you and thank you, because I end up using your Code instead of using my Code, yours is shorter , easier, than my code,Thank you again
    Smilies are ON

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width