Hello

Welcome, Guest. Please login or register.
Did you miss your activation email?

Author Topic: Visual Basic hell...  (Read 574 times)

Offline PS2_-'_'-_PS2
  • Sore Fingers
  • Hero Member
  • *****
  • Posts: 1729
  • Karma: +10/-0
    • http://
Visual Basic hell...
« on: January 22, 2003, 03:45:18 PM »
hi, i need to code this program for skool but there is a bit that i am finding incredibly bloody hard!

-The program takes in 6 \'scores\' and stores them in an array.
-Then using parameters and parameter passing(you have to use them evenalthough it woulld be simpler without) i have to find the maximum and the minimum score in the score array.

So does anyone have an old example of this or anything similar gathering dust in a file somewher, if so please post it. =]
Thanks.
i spent 3 hrs 2nite trying to do this and i still cant get the shit to work !!!!
help please if u can...
\"A key to the understanding of all religions is that a god\'s idea of amusement is Snakes and Ladders with greased rungs\"


http://www.purevolume.com/forgettheletterfour

Offline The Stapler
  • Eternal Shin Splints
  • Hero Member
  • *****
  • Posts: 1335
  • Karma: +10/-0
    • http://www.staples.com
Visual Basic hell...
« Reply #1 on: January 22, 2003, 04:03:32 PM »
VB = teh easy!

(in a module)

Global intScore(0 to 5)

(in the program)

for i = 0 to 5
intScore(i) = txtText(i).text
next i

dunno the rest (too long to code)

Offline EmperorRob
  • Mr Sexual Harassment
  • Legendary Member
  • ******
  • Posts: 3932
  • Karma: +10/-0
Visual Basic hell...
« Reply #2 on: January 22, 2003, 06:27:56 PM »
(My VB is rusty)
I could show you how to do it in C but that probably wouldn\'t help you.  If you have Visual Studio search the help menus for functions like min and max.  The one good thing I can say about VB is its help docs.
This is America and I can still pay for sex with pennies

Offline PS2_-'_'-_PS2
  • Sore Fingers
  • Hero Member
  • *****
  • Posts: 1729
  • Karma: +10/-0
    • http://
Visual Basic hell...
« Reply #3 on: January 23, 2003, 10:09:15 AM »
the guy i bought VB from still hasnt given me the help cd, ill have to get it from him sometime =]. I got told how to do it today anyway. you have to pass the whole array to the function before it will work. i hate VB! =]
\"A key to the understanding of all religions is that a god\'s idea of amusement is Snakes and Ladders with greased rungs\"


http://www.purevolume.com/forgettheletterfour

Offline The Stapler
  • Eternal Shin Splints
  • Hero Member
  • *****
  • Posts: 1335
  • Karma: +10/-0
    • http://www.staples.com
Visual Basic hell...
« Reply #4 on: January 23, 2003, 05:13:30 PM »
I don\'t really know of any languages that are easier than VB :)

Offline Avatarr
  • Wise Member

  • Hero Member
  • *****
  • Posts: 1647
  • Karma: +10/-0
    • http://www.sheepsheet.com
Visual Basic hell...
« Reply #5 on: January 23, 2003, 11:59:19 PM »
OMG VisualBasic! I don\'t know how you can look at it and not puke. The second you see the first global variable (which is very common in BASIC source code), you should turn arround and look somewhere else! AAHAAAAAHHHHHHHHHHH. I think C++ is a lot easier to look at.

Anyhooo....  why can\'t u just write a function and pass the entire arry to it?

Offline square_marker
  • Top Cop
  • Legendary Member
  • ******
  • Posts: 2721
  • Karma: +10/-0
Visual Basic hell...
« Reply #6 on: January 24, 2003, 02:21:18 PM »
i could do it easily in delphi but i dont think that would help you out much.

here goes anyway


type
atype:=array[1..6]of integer;

var
testscores:atype;

procedure high_low(var testscore:atype);
  var
 high,low:integer
     ct:integer;
        begin
           for ct:=1 to 6 do
           begin
             high:=length(testscores[ct])
             low:=revlength(testscores[ct])
          end;
        end;

   procedure print_data(testscores:atype);
     begin
      writeln(\'High score is \', high);
      writeln;
      writeln(\'Low score is \',low);
     end;


begin
high_low(testscores);
print_data(testscores);
end.


of course you might wanna get the info keyed in or through an infile    

hope that might give u some help.... my teacher told me that once you learn one language, all the others are no problem.
*****************

[COLOR=\"Blue\"]I found you Ms. New Booty[/COLOR]

Offline EmperorRob
  • Mr Sexual Harassment
  • Legendary Member
  • ******
  • Posts: 3932
  • Karma: +10/-0
Visual Basic hell...
« Reply #7 on: January 24, 2003, 02:57:38 PM »
Try using the code tags for that.

Ex:
[b]int[/b] hi = 0, low = 0;
[b]int[/b] numbers[10];

for (i=0; i < 10; i++) {
   numbers[i] > hi ? hi = numbers[i] : ;
   numbers[i] < low ? low = numbers[i] : ;
}
This is America and I can still pay for sex with pennies

Offline PS2_-'_'-_PS2
  • Sore Fingers
  • Hero Member
  • *****
  • Posts: 1729
  • Karma: +10/-0
    • http://
Visual Basic hell...
« Reply #8 on: January 24, 2003, 05:27:21 PM »
I eventually got it so its cool now, Thanks anyway guys.
I only have to write the evaluation and the algorithm now then im finished(!) =]
\"A key to the understanding of all religions is that a god\'s idea of amusement is Snakes and Ladders with greased rungs\"


http://www.purevolume.com/forgettheletterfour

Offline Avatarr
  • Wise Member

  • Hero Member
  • *****
  • Posts: 1647
  • Karma: +10/-0
    • http://www.sheepsheet.com
Visual Basic hell...
« Reply #9 on: January 25, 2003, 12:26:25 AM »
thats a bit of a hoochoo. you write the algorithm before you code? you\'re going backwards in time little boy@! always write ur algorithm first@!

Offline PS2_-'_'-_PS2
  • Sore Fingers
  • Hero Member
  • *****
  • Posts: 1729
  • Karma: +10/-0
    • http://
Visual Basic hell...
« Reply #10 on: January 26, 2003, 02:24:47 PM »
If u use \'bottom up design\' u write the code first i know it seems strange but there must be some advantages to the method. Anyway im not using that method, i meant i had to amend my algorithm coz a lot of things had changed =]. Anyway i have more important things on my mind now like my bloody English prelim 2morrow!!! =]
\"A key to the understanding of all religions is that a god\'s idea of amusement is Snakes and Ladders with greased rungs\"


http://www.purevolume.com/forgettheletterfour

Offline Avatarr
  • Wise Member

  • Hero Member
  • *****
  • Posts: 1647
  • Karma: +10/-0
    • http://www.sheepsheet.com
Visual Basic hell...
« Reply #11 on: January 26, 2003, 06:54:55 PM »
yeah well, if you had a good algorithm to begin with you\'d have more time for that english prelim 2morrow. :P

Oh whell, GL. I guess u need it.

Offline PS2_-'_'-_PS2
  • Sore Fingers
  • Hero Member
  • *****
  • Posts: 1729
  • Karma: +10/-0
    • http://
Visual Basic hell...
« Reply #12 on: January 27, 2003, 07:53:50 AM »
thats a good point. The prelim didnt go 2 badly but maths is on wednesday and is gonna be impossible! =]
\"A key to the understanding of all religions is that a god\'s idea of amusement is Snakes and Ladders with greased rungs\"


http://www.purevolume.com/forgettheletterfour

 

SMF spam blocked by CleanTalk