Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Computer Forums > Programmers Lounge > Programming Discussions » Help with VB Code please!? VERY URGENT! JUST A QUICK THING! IF..ELSE...
Closed Thread
Old 04-27-2006, 07:59 PM   #1 (permalink)
 
Newb Techie

Join Date: Apr 2006

Posts: 1

bilal_zd

Default Help with VB Code please!? VERY URGENT! JUST A QUICK THING! IF..ELSE...

Can somebody tell me if this makes sense please, I need it URGENTLY PLEASE....I am trying to put the "false" value as another IF function, if that makes sense? I just need to know it is ok? It is really for a certain grade function, so that my system can display a grade of, A, B, C, D, E, U...depending on what the "total mark" is. If it doesn't...how would it be done? Thankyou:


If [Total_Mark] < 40 Then
result = "U"

Else

If [Total_Mark] < 50 Then
result = "E"

Else

If [Total_Mark] < 60 Then
result = "D"

End If




Please can somebody help! Thankyou! The code will keep goin onto 80 marks, and to grade A, but I left it at grade D for the purpose of not making this thread too big! Thanks in advance, need it in next few hours please! Thanks!
bilal_zd is offline  
Old 04-29-2006, 07:55 PM   #2 (permalink)
 
Ultra Techie

Join Date: Sep 2005

Posts: 638

tommyboy123x is on a distinguished road

Send a message via AIM to tommyboy123x
Default

hm.... im not a VB buff yet... starting that next year...

but if it were similar to php then you should put it in some kind of thing like the switch command... here is an example

in PHP, $x signifies "variable x"
echo = print, printf, cout, etc (print on screen)

Code:
$destination = "Tokyo";
echo "Traveling to $destination
";   //"traveling to tokyo"
switch ($destination){
    case "Las Vegas":                        //if it is $destination = las vegas
         echo "Bring an extra $500";    //bring extra money
         break;                                      //end case 1
     case "Amsterdam":                      // etc
         echo "Bring an open mind";
         break;
     case "Egypt":
         echo "Bring 15 bottles of SPF 50 Sunscreen";
         break;
     case "Tokyo":
         echo "Bring lots of money";
         break;
     case "Caribbean Islands":
         echo "Bring a swimsuit";
         break;
}
or, if you could say in VB something like

Code:
if 0 < [Total_Mark] < 40   #if Total_Mark = 0-40...
result = "U"                      #result = U
and just skip out on the Else's

however, again, i dont know VB really... i've only played with it and made stupid windows and stuff
__________________

Some real (as in actual) surveys that pay money!
tommyboy123x is offline  
 
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On