Author Topic: Vizzy B  (Read 4701 times)

Offline [BTF]adam

  • Brobdingnagian Member
  • ***
  • Posts: 4047
    • View Profile
    • adam.tastyspleen.net
  • Rated:
Vizzy B
« on: April 09, 2009, 01:56:03 AM »
Heyhey I have an assignment to write 9 VB mini programs, problem is I was off ill for a ridiculous amount of time and missed a lot of simple stuff thats holding me back in finishing these, if I post a couple im stuck with, do any of you know VB sufficiently enough to perhaps lend me a hand?

/adam
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus

Offline [BTF]adam

  • Brobdingnagian Member
  • ***
  • Posts: 4047
    • View Profile
    • adam.tastyspleen.net
  • Rated:
Re: Vizzy B
« Reply #1 on: April 09, 2009, 07:53:58 AM »
Here's an example of the type of thing I mean, this is one I already have done:

Question 4 – Pelican Traffic Lights

The problem
A program is needed to simulate the sequence of event that happens when someone presses the button at a Pelican crossing. What should happen is as follows:
1.   Car lights change from Green to Amber
2.   Car lights change from Amber to Red
3.   Pelican lights change from Red to Green
4.   Pelican lights change from Green to Red
5.   Car lights change from Red to Red and Amber
6.   Car lights change from Red and Amber to Green

Obviously, in a real situation there would be different delays but these are not included in this simulation.


What you have to do
What you need is an integer (or better still and Enumerated variable) which determines what state the traffic light sequence has got up to and moves the sequence from one state to the next every time a Command Button is pressed. There are six states as indicated above. It is a requirement of this exercise that only the Properties that absolutely need changing should be updated after each click of the Command Button.

and the program listing:

Public Class Form1
    Dim i As Integer
    Private Sub BntStart_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStart.Click
        i = i + 1

        If i = 1 Then
            picGreen.Visible = False
            picAm.Visible = True
        End If

        If i = 2 Then
            picAm.Visible = False
            picRed.Visible = True
        End If

        If i = 3 Then
            picPel.BackColor = Color.Green
        End If

        If i = 4 Then
            picPel.BackColor = Color.Red
        End If

        If i = 5 Then
            picRed.Visible = False
            picRedam.Visible = True
        End If

        If i = 6 Then
            picRedam.Visible = False
            picGreen.Visible = True
            i = 0
        End If


    End Sub

    Private Sub btnEnd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnEnd.Click
        End
    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub
End Class

[note: this is a slightly older version i've got a newer one around somewhere where it's commented n stuff.
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus

Offline Whirlingdervish

  • Super ShortBus Extravaganza
  • Illimitable Sesquipedalian Member
  • *
  • Posts: 6384
    • View Profile
    • The Dervish Depository
  • Rated:
Re: Vizzy B
« Reply #2 on: April 09, 2009, 12:01:46 PM »
What you have to do
What you need is an integer (or better still and Enumerated variable) which determines what state the traffic light sequence has got up to and moves the sequence from one state to the next every time a Command Button is pressed. There are six states as indicated above. It is a requirement of this exercise that only the Properties that absolutely need changing should be updated after each click of the Command Button.

and the program listing:

Public Class Form1
    Dim i As Integer
    Private Sub BntStart_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStart.Click
        i = i + 1

        If i = 1 Then
            picGreen.Visible = False
            picAm.Visible = True
        End If

        If i = 2 Then
            picAm.Visible = False
            picRed.Visible = True
        End If

        If i = 3 Then
            picPel.BackColor = Color.Green
        End If

        If i = 4 Then
            picPel.BackColor = Color.Red
        End If

        If i = 5 Then
            picRed.Visible = False
            picRedam.Visible = True
        End If

        If i = 6 Then
            picRedam.Visible = False
            picGreen.Visible = True
            i = 0
        End If


    End Sub

    Private Sub btnEnd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnEnd.Click
        End
    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub
End Class

[note: this is a slightly older version i've got a newer one around somewhere where it's commented n stuff.


you can shorten that huge block of If's into one Select statement in vb that will save you some time and do the exact same thing while improving readability like so:


Select Case i

Case 1

picGreen.Visible = False
picAm.Visible = True

Case 2

picAm.Visible = False
picRed.Visible = True

Case 3

picPel.BackColor = Color.Green

Case 4

picPel.BackColor = Color.Red

Case 5

picRed.Visible = False
picRedam.Visible = True

Case 6

picRedam.Visible = False
picGreen.Visible = True

i = 0

End Select



It's essentially a big long If statement with Else Ifs that will be used to handle a single variable with any number of possible values and you can even use a "Case Else" like you'd use the Else statement if you want your conditional to have an action if the value is outside of the ones you're looking for.

I have a little bit of background knowledge in older forms of VB so I can probably help you a bit, but I'll be useless when it comes to the .NET stuff.





« Last Edit: April 09, 2009, 12:09:35 PM by Whirlingdervish(Q2C) »
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus

Offline reaper

  • Opulent Member
  • *
  • Posts: 2872
  • Nice night for a walk, eh? - Nice night for a walk
    • View Profile
  • Rated:
Re: Vizzy B
« Reply #3 on: April 09, 2009, 03:09:00 PM »
You can use VB in a .NET enviornment.
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus
VaeVictus "reaper is a lying sack of shit and ragequit then had, probably slugs, come alias and beat me, wasnt even the same person playing OBVIOUSLY, accuracies basicly doubled, and strategy

Offline [BTF]adam

  • Brobdingnagian Member
  • ***
  • Posts: 4047
    • View Profile
    • adam.tastyspleen.net
  • Rated:
Re: Vizzy B
« Reply #4 on: April 09, 2009, 03:19:57 PM »
Cheers whirlzer, I won't need to use any .net stuff or anything though I don't think. I'll be starting to mosh on through these proggys at the start of next week I guess.

ta!
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus

Offline Whirlingdervish

  • Super ShortBus Extravaganza
  • Illimitable Sesquipedalian Member
  • *
  • Posts: 6384
    • View Profile
    • The Dervish Depository
  • Rated:
Re: Vizzy B
« Reply #5 on: April 09, 2009, 05:16:27 PM »
after you use the dim statement to make that integer (or any other type of variable) it is always a good practice to set it to an initial value so that whatever used to be stored at that memory location doesn't fuxor your program up when you do something like increment it.

in this case, you'd want a line after "Dim i as Integer" that says "i = 0" just to make sure it really is 0 the first time the button is pushed.

I'll be around, so just post away on these lil buggers when you get em.
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus

Offline [BTF]adam

  • Brobdingnagian Member
  • ***
  • Posts: 4047
    • View Profile
    • adam.tastyspleen.net
  • Rated:
Re: Vizzy B
« Reply #6 on: April 10, 2009, 01:59:07 AM »
yeah I do have i = 0 in most programs where i use the dim statement, i didnt do most of this one though got a hand with it from someone in class :P
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus

Offline [BTF]adam

  • Brobdingnagian Member
  • ***
  • Posts: 4047
    • View Profile
    • adam.tastyspleen.net
  • Rated:
Re: Vizzy B
« Reply #7 on: April 13, 2009, 04:31:02 AM »
aight first one, i've half finished this one but I can't figure out the last couple of bits: basically its a questionairre type thing, asks for qualifications, place of study and reg code, then when you click submit it will display it on as second form, here's some screens of what I mean + the code i got so far.

(its a mess i know)

Public Class Form1

    Private Sub RadioButton2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)

    End Sub

    Private Sub btnQuit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnQuit.Click
        'Quit
        End
    End Sub

    Private Sub GroupBox1_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles groupSchool.Enter

    End Sub

    Private Sub btnSubmit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSubmit.Click
        Me.Hide()
        Form2.Show()
        Form2.txtReg.Text = Me.txtReg.Text
    End Sub

    Private Sub txtReg_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtReg.TextChanged

    End Sub

    Private Sub radioSixth_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles radioSixth.CheckedChanged
    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub
End Class


  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus

Offline [BTF]adam

  • Brobdingnagian Member
  • ***
  • Posts: 4047
    • View Profile
    • adam.tastyspleen.net
  • Rated:
Re: Vizzy B
« Reply #8 on: April 13, 2009, 04:33:14 AM »
to clarify, what I need to do is be able to have the school and qualification show up in the second form too, from whichever one is selected of course, but i dunno how to do it
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus

Offline [BTF]adam

  • Brobdingnagian Member
  • ***
  • Posts: 4047
    • View Profile
    • adam.tastyspleen.net
  • Rated:
Re: Vizzy B
« Reply #9 on: April 13, 2009, 06:17:56 AM »
Ok here's another problem, we need a current image (picBee) to, when it hits, Mr T, (picFool), have a pop up come up saying you just won the game. and we also need to when the picBee goes off the edge of the screen, to pop up saying YOU LOST OLOLOL! if you need the program listing ill give it you
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus

Offline jägermonsta

  • Brobdingnagian Member
  • ***
  • Posts: 4441
  • Bigger Than Jesus
    • View Profile
  • Rated:
Re: Vizzy B
« Reply #10 on: April 13, 2009, 06:38:01 AM »
f that man, hire some indian to do your projects for like $5 each, that's what I did. I graduated with a 3.8 gpa and I'm doing what I initially went to college for, system/network administrating. fuck programming. "oh but if you know some basic programming it can help you" NO IT DOESNT SHUT UP ALREADY
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus

Offline [BTF]adam

  • Brobdingnagian Member
  • ***
  • Posts: 4047
    • View Profile
    • adam.tastyspleen.net
  • Rated:
Re: Vizzy B
« Reply #11 on: April 13, 2009, 07:58:59 AM »
scrap those two i've done them. :yessign: got a few real tough cookies left though

and lol jager if i could i would :P
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus

Offline Whirlingdervish

  • Super ShortBus Extravaganza
  • Illimitable Sesquipedalian Member
  • *
  • Posts: 6384
    • View Profile
    • The Dervish Depository
  • Rated:
Re: Vizzy B
« Reply #12 on: April 13, 2009, 08:32:09 AM »
looks like you figured out how to make a global variable so you can pass shit between forms.

 :yessign:
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus

Offline [BTF]adam

  • Brobdingnagian Member
  • ***
  • Posts: 4047
    • View Profile
    • adam.tastyspleen.net
  • Rated:
Re: Vizzy B
« Reply #13 on: April 17, 2009, 05:05:07 AM »
Alright here's one I can't quite work out how to do:

Problem - a file contains records of employee salaries and an algorithm is needed to find the number of employees classified as trainees, who earn more than 20000 a year and who have been with the company for less than 2.

record contains these lines: name, number, salary, years with comp, employee classification

"please remember to open and close the employee filoe, do not read beyond the end of the file, include a loop to look at each record of the file in turn working from the beginning of the file to the end of the file marker

HOWEVER

this needs to be in pseudo code I dont actually code it properly, anddddd I hate pseudocode it stumps me :P
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus

Offline Whirlingdervish

  • Super ShortBus Extravaganza
  • Illimitable Sesquipedalian Member
  • *
  • Posts: 6384
    • View Profile
    • The Dervish Depository
  • Rated:
Re: Vizzy B
« Reply #14 on: April 17, 2009, 08:50:02 AM »
well to open and read that file you'll want to handle it with a while loop that checks for the end of file and read it one line per pass of the loop and handle that line of info before the loop continues.



declare an array of strings for each data value that you need (name, number, salary, years with comp, employee classification)
declare long integer file length counter
declare a string to hold each line in the loop called templine or something
declare some long ints to increment and use as checks/index positions for your loops (index, index2)
declare an array of long integers for each value you're supposed to look for (trainees,salary,years)


open file for input as #1


While not at the end of file #1

increment a long int called index 1 time for each pass of the loop. (you'll use this later as the filelength)

use Line Input on file #1 to read the line into a string called templine

use the InStr function on the templine string to locate the positions of commas in the line and save these values to temporary integers or to an array of integers

use these temporary comma location integers as starting and ending locations to send to the mid$ function to truncate the record to each value that you want (whats between the commas) and place these values into the arrays of strings for each one (name, number, salary, years with comp, employee classification) using the index long int as the position in the arrays for storing the values exactly in the same place in each array.

this way name(index) and salary(index) etc. will hold values for the exact same employee as long as the values of index are the same

wend (go back to the start of the loop after each line has been cut up and stored appropriately, until there are no more lines to read from the file)

after everything is read, close the file using: Close #1

now save the incremented value of how many lines were in the file (index) to the filelength counter long int that you made just for that value.

reset index to 0 for use as a counter in your for loops later



now at least you've read the file and stored the data..
I'll pop in later and try to give you a hand with the comparing part since its a bit tougher.

(you could check them as you cut the line up and only store the ones that are applicable, or you can check them all later from the arrays)
« Last Edit: April 17, 2009, 08:52:01 AM by Whirlingdervish(Q2C) »
  • Insightful
    Informative
    Funny
    Nice Job / Good Work
    Rock On
    Flawless Logic
    Well-Reasoned Argument and/or Conclusion
    Demonstrates Exceptional Knowlege of the Game
    Appears Not to Comprehend Game Fundamentals
    Frag of the Week
    Frag Hall of Fame
    Jump of the Week
    Jump Hall of Fame
    Best Solution
    Wins The Internet
    Whoosh! You done missed the joke thar Cletus!
    Obvious Troll Is Obvious
    DO YOU EVEN LIFT?
    DEMO OR STFU
    Offtopic
    Flamebait
    Redundant
    Factually Challenged
    Preposterously Irrational Arguments
    Blindingly Obvious Logical Fallacies
    Absurd Misconstrual of Scientific Principles or Evidence
    Amazing Conspiracy Theory Bro
    Racist Ignoramus

 

El Box de Shoutamente

Last 10 Shouts:

 

|iR|Focalor

April 24, 2024, 10:55:53 AM
omlette du fromage?
 

Admin

April 24, 2024, 07:08:22 AM
fin.
 

|iR|Focalor

April 22, 2024, 04:27:07 PM
Now it's over. Because I say it's over.
 

|iR|Focalor

April 22, 2024, 12:39:29 PM
It's over when I say it's over.

 

|iR|Focalor

April 22, 2024, 11:34:16 AM
Costigan needs a tampon.
 

Costigan_Q2

April 22, 2024, 02:53:12 AM
This interaction is over.
 

Costigan_Q2

April 22, 2024, 02:51:20 AM
Will someone please muzzle and leash that barking dog? it's projections and delusions and now endless babbling are comically pitiable, just treat it like you would Beaver - that's what it deserves.
 

Costigan_Q2

April 22, 2024, 02:50:50 AM
Quake 2 needs a public square.

This is not a debate.
 

|iR|Focalor

April 21, 2024, 05:36:24 PM
If you were attached to reality, you'd realize that.

Quake 2 needs a private bathroom.
 

|iR|Focalor

April 21, 2024, 05:34:35 PM
I've never doxed anyone like he did or sent them 1000's of annoying whiny angry messages in all caps like you.

Show 50 latest
Welcome, Guest. Please login or register.
May 01, 2024, 02:47:37 PM

Login with username, password and session length