|
-
Nov 25th, 2001, 02:30 AM
#1
Thread Starter
Member
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
-
Nov 25th, 2001, 02:39 AM
#2
Please if your going to ask a question post it in a mannor that it can be clearly Understood.
-
Nov 25th, 2001, 02:47 AM
#3
Frenzied Member
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
-
Nov 25th, 2001, 02:56 AM
#4
-
Nov 25th, 2001, 09:51 AM
#5
Thread Starter
Member
-
Nov 25th, 2001, 10:02 AM
#6
Thread Starter
Member
-
Nov 25th, 2001, 11:43 AM
#7
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:
Dim dCost As Double
dCost = (UBound(Split(txtItems.Text, ",")) + 1) * .75
'add code here to add $5, $7 or $9 to dCost depending on the size.
MsgBox "The cost for the pizza is " & Format(dCost, "$##0.00")
Best regards
-
Nov 25th, 2001, 11:45 AM
#8
dCost = (UBound(Split(txtItems.Text, ",")) + 1) * .75
Why Ubound ? Ubound is used for Array variable...and you didnt declare any Array ?
-
Nov 25th, 2001, 11:48 AM
#9
PowerPoster
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
-
Nov 25th, 2001, 11:50 AM
#10
forget
-
Nov 25th, 2001, 09:56 PM
#11
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
-
Nov 25th, 2001, 10:21 PM
#12
Addicted Member
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!
-
Nov 26th, 2001, 07:39 AM
#13
Thread Starter
Member
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
-
Nov 26th, 2001, 08:35 PM
#14
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:
Dim dCost As Double
Dim sSize As String ' set this to a value of small, medium, or large
depending on which option button is selected
Dim sOutput As String 'we use this string to contain the output
' Insert the cost calculation here as showed earlier
' Set the sSize variable to a value of SMALL, MEDIUM or LARGE here depending on the value of the option buttons
sOutput = "A " & sSize " pizza with " & UBound(Split(txtItems.Text, ",")) + 1 & _
" items to be delivered to " & txtAddress.Text & " " & txtSteet.Text & _
" " & txtAvenue.Text & " at a cost of $" & _
Format(dCost, "###0.00")
MsgBox sOutput 'or asign it sOutput to a TextBox or whatever you want
I hope this make any sense to you.
Best regards
-
Nov 26th, 2001, 09:24 PM
#15
Thread Starter
Member
-
Nov 26th, 2001, 09:52 PM
#16
Thread Starter
Member
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.
-
Dec 5th, 2001, 03:16 AM
#17
Thread Starter
Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|