|
10-01-2012, 08:36 PM | #1401 |
Pro Golfer
|
im batman
__________________
I eat pieces of shit like you for breakfast. |
10-01-2012, 08:40 PM | #1402 |
Bovinus Administratus
Join Date: Feb 2009
Location: Greener pastures
Posts: 32,377
|
No, I'm Batman.
__________________
|
10-01-2012, 08:43 PM | #1403 |
Pro Golfer
|
i hate that picture
__________________
I eat pieces of shit like you for breakfast. |
10-01-2012, 08:47 PM | #1404 |
Bovinus Administratus
Join Date: Feb 2009
Location: Greener pastures
Posts: 32,377
|
No, I hate that picture!
[IMG]Kermit De Frog holding fake-ass cartoon bomb above his head while constipated[IMG]
__________________
|
10-02-2012, 02:40 AM | #1405 | |
Bovinus Administratus
Join Date: Feb 2009
Location: Greener pastures
Posts: 32,377
|
Sometimes I wonder if maybe I'm not doing a good enough job. Am I professional enough? Am I protecting my users from downtime and data loss enough?
http://www22.verizon.com/Support/Res...ZZ_Z_ZZ_N_Z123 Quote:
In other news, I know a better way to merge two Exchange/Outlook calendars than the answers that Google provides. Google it and you'll get Microsoft pages and forum posts saying to export the calendar and then import it. There IS a better, faster way. Instead, click the View ribbon, and the first button on the left is "Change View". Click that and choose "List". Now your calendar is displayed as a folder full of items. Click any one, Ctrl+A to select all, right-drag to destination calendar, choose Copy or Move from the context menu. Celebrate.
__________________
|
|
10-02-2012, 02:55 AM | #1406 | ||
C-E-Z★ bitch
|
halp? trying to figure out why this shit wont calculate right. it does the first two examples right but the other two i get bad numbers
Quote:
example numbers are 1.5 Kgs and 100 miles (total should equal to $1.00) 5 Kgs and 200 miles (total should equal to $3.00) 8 Kgs and 750 miles (total should equal to $15.00) I get $11.25 15 Kgs and 2000 miles (total should equal to $50.00) I get $30.00
__________________
Quote:
|
||
10-02-2012, 01:44 PM | #1407 |
Bovinus Administratus
Join Date: Feb 2009
Location: Greener pastures
Posts: 32,377
|
Desk-checking that with my vague ability to remember anything about programming, your code looks like it should work.
Have you checked the value of each variable, all along the way? Your IDE may provide ways to do this, but I would usually insert an output and pause (dialog box in a GUI program or print and input prompt in CLI) between each operation, showing me current position and each variable that's in play. Here's your code with some pseudocode to demonstrate what I'm talking about: Code:
Select Case decTxtWeight Case Is <= 2 decMileageCost = 0.01D dialogue("Case <=2; decMileageCost = " + decMileageCost + "; decTxtWeight = " + decTxtWeight) Case Is > 2 And CInt(decTxtWeight <= 6) decMileageCost = 0.015D dialogue("Case >2; decMileageCost = " + decMileageCost + "; decTxtWeight = " + decTxtWeight) Case Is > 6 And CInt(decTxtWeight <= 10) decMileageCost = 0.02D dialogue("Case >6; decMileageCost = " + decMileageCost + "; decTxtWeight = " + decTxtWeight) Case Is > 10 And CInt(decTxtWeight <= 20) decMileageCost = 0.025D dialogue("Case >10; decMileageCost = " + decMileageCost + "; decTxtWeight = " + decTxtWeight) End Select dialogue("Case ended; decMileageCost = " + decMileageCost + "; decTxtWeight = " + decTxtWeight) dialogue("decTxtDistance = " + decTxtDistance) decTxtCharge = decMileageCost * decTxtDistance dialogue("decTxtCharge = " + decTxtCharge + "decMileageCost = " + decMileageCost "; decTxtDistance = " + decTxtDistance) TxtCharge.Text = Format(decTxtCharge, "0.00") Some other comments: Is it necessary to convert to integer for the second condition in each case? If so, why is it not necessary to convert to integer for the first condition? Is the second condition even necessary? Some languages may process the entire Select before making a decision, some may drop out of the Select on the first match.
Also, you're missing a catch-all for when decTxtWeight is over 20. In a real-life situation you'd have a catch-all for all decTxtWeight values not covered by the Select, and usually you'd skip the last Case and let the catch-all handle it
__________________
|
10-02-2012, 02:02 PM | #1408 |
Join Date: Feb 2009
Location: Hoenn
Posts: 85,082
|
Make catch all that pops up a message saying "over 20? Gooby pls."
Sent from my Galaxy Nexus
__________________
|
10-02-2012, 02:22 PM | #1409 | ||
C-E-Z★ bitch
|
Quote:
idk why i should make the first convert to an integer if it works what second condition are ye talking aboot?
__________________
Quote:
|
||
10-02-2012, 02:31 PM | #1410 |
Bovinus Administratus
Join Date: Feb 2009
Location: Greener pastures
Posts: 32,377
|
So I don't know why and you don't know why...how did the CInt get there?
The second condition is "And CInt(decTxtWeight blah blah blah". The first condition is "Case Is > number". Wait a minute, I may have found the problem. "CInt(decTxtWeight <= 6)" If you take CInt out of that, the value of (decTxtWeight <= 6) is boolean, isn't it? I think what you were trying to do (though I don't know why) is "CInt(decTxtWeight) <= 6" (substitute other numbers in other cases).
__________________
|
10-02-2012, 02:38 PM | #1411 | |
C-E-Z★ bitch
|
internet
i thought the cint was kinda like "do this with this number if its greater than interger entered" and ill remove that Cint @ home since i no bring lappy
__________________
Quote:
|
|
10-02-2012, 02:41 PM | #1412 |
Bovinus Administratus
Join Date: Feb 2009
Location: Greener pastures
Posts: 32,377
|
__________________
|
10-02-2012, 02:42 PM | #1413 | |
C-E-Z★ bitch
|
:redturtleshell:
__________________
Quote:
|
|
10-02-2012, 02:49 PM | #1414 |
Bovinus Administratus
Join Date: Feb 2009
Location: Greener pastures
Posts: 32,377
|
http://stackoverflow.com/questions/4...-parse-vs-cint
"So in short, CInt does much more than convert a string to an integer, e.g. applying specific rounding rules to fractions, short circuting unecessary conversions etc."
__________________
|
10-02-2012, 02:50 PM | #1415 |
♪♫Boogie Woogie King♫♪
Join Date: Feb 2009
Location: Jurrjah
Posts: 12,568
|
Ordered toner..
for wrong printer
__________________
|
10-02-2012, 03:07 PM | #1416 |
Join Date: Feb 2009
Location: Hoenn
Posts: 85,082
|
__________________
|
10-03-2012, 12:42 AM | #1417 | |
C-E-Z★ bitch
|
cao. wont run without the Cint
says "expression is not an array or method, and cannot have an argument list" ---------- Post added at 06:42 PM ---------- Previous post was at 06:38 PM ---------- ok so just now i hhad removed the "and Cint" this time i removed "Cint" only. now it tells me "option strict on disallows implicit conversions from boolean to integer"
__________________
Quote:
|
|
10-03-2012, 01:07 AM | #1418 |
Bovinus Administratus
Join Date: Feb 2009
Location: Greener pastures
Posts: 32,377
|
Ok, that kinda makes sense, it's looking for an integer value and the test on the right is boolean. However, converting it to an integer doesn't make it into good logic. Boolean means true/false; when you convert it to an integer you get 1 or 0. So, a statement like this:
Case Is > 2 And CInt(decTxtWeight <= 6) really means Case Is > 2 And 0 or Case Is > 2 And 1 depending on decTxtWeight. I think you need to get rid of the "And" and everything to its right, then you may need to repair the logic.
__________________
|
10-03-2012, 01:10 AM | #1419 | |
C-E-Z★ bitch
|
i get the "expression is not an array or method and cannot have an argument list" again
__________________
Quote:
|
|
10-03-2012, 01:17 AM | #1420 |
Bovinus Administratus
Join Date: Feb 2009
Location: Greener pastures
Posts: 32,377
|
What language is it?
Why does the first case not return any errors without the crap on the right but the rest need crap on the right?
__________________
|
10-03-2012, 01:19 AM | #1421 | |
C-E-Z★ bitch
|
idk and thats whats pising me off
language = english tehre some VB site i can ax for halp?
__________________
Quote:
|
|
10-03-2012, 01:25 AM | #1422 |
Bovinus Administratus
Join Date: Feb 2009
Location: Greener pastures
Posts: 32,377
|
So it's VB? VB.net, I assume?
__________________
|
10-03-2012, 01:26 AM | #1423 | |
C-E-Z★ bitch
|
visual basic.
whys that site in doitch
__________________
Quote:
|
|
10-03-2012, 01:27 AM | #1424 |
Bovinus Administratus
Join Date: Feb 2009
Location: Greener pastures
Posts: 32,377
|
I'm asking if it's VB.net, not suggesting you go to a site whose address is VB.net. http://en.wikipedia.org/wiki/Visual_Basic_.NET
__________________
|
10-03-2012, 01:29 AM | #1425 | |
C-E-Z★ bitch
|
yea vb.net
__________________
Quote:
|
|
Bookmarks |
Tags |
big floppy donkey dick, chance is gay, i play mw2 on pc, information technology, it sekz, iz no it gai, nerds |
Currently Active Users Viewing This Thread: 6 (0 members and 6 guests) | |
Thread Tools | |
Display Modes | |
|
|