I figured it out, but thanks anyway ______________________________________________ "I'm not me when I dream...anymore." -TRUSTcompany
xBlitzerx
Posts
-
Database: An Array of Structures -
Database: An Array of StructuresThis is what i have so far..and i'm getting an error... Module Exercise4 Private Structure Game Dim name, genre As String Dim rating As Single End Structure Sub Main() Dim gameArray() As Game Dim choice, count As Integer Dim name, genre As String Dim rating As Single Call DisplayMainMenu() choice = CInt(Console.ReadLine()) If choice = 1 Then Console.Write("Enter the name of the game: ") gameArray(0).name = CStr(Console.ReadLine()) End If Console.ReadLine() End Sub Private Sub DisplayMainMenu() Console.WriteLine(" Game Database" & vbCrLf & " -------------") Console.WriteLine(vbCrLf & "1) Add a Game" & vbCrLf & "2) Display a Game") Console.WriteLine("3) Display Rating Average" & vbCrLf & "4) Display Rating Summary") Console.WriteLine("5) Quit" & vbCrLf) Console.Write("Enter a choice: ") End Sub End Module ______________________________________________ "I'm not me when I dream...anymore." -TRUSTcompany
-
Database: An Array of StructuresI am using VB.Net.. I have been trying this for awhile... Im making a simple console app that is a database for different video games. It will store the name, genre and a rating out of 10.. But I want it set up as several sub procedures to clean up my code. Also because I hoped it would look like an old DOS menu based system... Something like this: Games Database -------------- 1) Add a game 2) Display a games info 3) Display rating average 4) Display rating summary 5) Delete a game 6) Quit Enter a choice:_ ______________________________________________ "I'm not me when I dream...anymore." -TRUSTcompany
-
Returning more than 1 value from a functionThanks Ray that kinda helps... but i'm still not sure why i'm doing that... Maybe i didnt explain it good enought.. I making an array, that has 3 members (name, genre, rating) Overall i want a little menu 1) Add a game 2) Display a game 3) Show average rating of games 4) Quit Something like that..so first i made a sub prodecure that displayed this menu (so i can call it after each option the user makes), that was all good So the sub main looks like this so far Private Sub Main() Dim gamesArray() as Game 'Game is a declared structure above sub main) Dim choice as integer call DisplayMainMenu() choice = console.readline() End Sub So then I started to do this: Private Sub Main() Dim gamesArray() as Game 'Game is a declared structure above sub main) Dim choice as integer call DisplayMainMenu() choice = console.readline() If choice = 1 then * call AddGame() End if End Sub Private Function AddGame() console.write("Enter the game name: ") name = console.readline() console.write("Enter the genre: ") genre = console.readline() console.write("Enter the games rating: ") rating = console.readline() End Function *** So my question being, if i get the info for the game in the function.. i somehow need to get all 3 pieces back up into the array... Hope this clarifies things...:-D EDIT: Sorry forgot the IF ______________________________________________ "I'm not me when I dream...anymore." -TRUSTcompany
-
Returning more than 1 value from a functionOk im using VB.net, a console app. I am making a database that stores games(members also, name, genre, rating) i'm dividing the main code into some sub procdures and functions for easier readability. So i have one sub for displaying the main menu(add, view..etc) But now i wanna make a function to add a game to the array... so i ask the user for the info, but how do i return all the values seperatly?? i tried assigning them directly to the array(gameArray.name = console.readline()), but it doesnt work... Any ideas will help!! ______________________________________________ "I'm not me when I dream...anymore." -TRUSTcompany
-
checking for a numeric value in a loopim new to programming... but couldn't you use the IsNumeric() function, if u get true back, just convert it to whichever type u need? CInt, CSng, CDec...etc. Sorry if i don't know what i'm talking about ______________________________________________ "I'm not me when I dream...anymore." -TRUSTcompany
-
Direct me to a GOOD VB.Net Tutorial?I dont think i need the Intro, kinda intermediate/beginner, im taking it in college. i've read the main textbook(a few times now). Which explains the basics of programming(and some of .Net)e.g.loops, control structures,sytnax,semantics, etc... But i need something more, about all this crazy .Net framwork stuff...lol It boggles my mind! :) Thanks in Advance :) ______________________________________________ "I'm not me when I dream...anymore." -TRUSTcompany
-
VB.Net Tutorials (Real Ones)Please someone one respond!!! ______________________________________________ "I'm not me when I dream...anymore." -TRUSTcompany
-
VB.Net Tutorials (Real Ones)Please someone respond!!! ______________________________________________ "I'm not me when I dream...anymore." -TRUSTcompany
-
VB.Net Tutorials (Real Ones)hey, i'll post this again, it got deleted last time.. All i wanna know is where I can find some GOOD tutorials for VB.Net I've read my textbook several times... Possibly a tutorial for graphics (games) Thanks ______________________________________________ "I'm not me when I dream...anymore." -TRUSTcompany
-
Resolution Or Screen Area :confused: -
Functions - Parameter Passingi asked the professor what i forgot was that when u call the function you have to store the value somewhere: thanks though :) ex: Sub Main() Dim int as integer int = MyFunction(5) End Sub Private Function MyFunction(ByVal int as integer) as integer Dim sum as integer sum = int * 10 return sum End Function ---------------------------------------------------------------------------- This works right? ______________________________________________ "I'm not me when I dream...anymore." -TRUSTcompany
-
Functions - Parameter Passingthanks for the help! NOT! ______________________________________________ "I'm not me when I dream...anymore." -TRUSTcompany
-
integerits rounding up... .5 or higher rounds it up.. i believe there is a function to format numbers...i can't remember it though..sorry "I'm not me when I dream...anymore." -TRUSTcompany
-
Functions - Parameter PassingIs there a tutorial on this somewhere? I'm going nuts here.... how many different variables do i need? i'm writing a program that uses a function to accept a number as a parameter. make some calculations to it, and return it.. then sub main will output the results... don't give me code please...i just want some pointers... "I'm not me when I dream...anymore." - TRUSTcompany