Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Database: An Array of Structures

Database: An Array of Structures

Scheduled Pinned Locked Moved Visual Basic
csharpdatabasegame-devdata-structures
4 Posts 2 Posters 2 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • X Offline
    X Offline
    xBlitzerx
    wrote on last edited by
    #1

    I 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

    X 1 Reply Last reply
    0
    • X xBlitzerx

      I 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

      X Offline
      X Offline
      xBlitzerx
      wrote on last edited by
      #2

      This 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

      N 1 Reply Last reply
      0
      • X xBlitzerx

        This 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

        N Offline
        N Offline
        Nick Seng
        wrote on last edited by
        #3

        What's the error and where does it point to? Notorious SMC


        The difference between the almost-right word & the right word is a really large matter - it's the difference between the lightning bug and the Lightning Mark Twain
        Get your facts first, and then you can distort them as much as you please Mark Twain

        X 1 Reply Last reply
        0
        • N Nick Seng

          What's the error and where does it point to? Notorious SMC


          The difference between the almost-right word & the right word is a really large matter - it's the difference between the lightning bug and the Lightning Mark Twain
          Get your facts first, and then you can distort them as much as you please Mark Twain

          X Offline
          X Offline
          xBlitzerx
          wrote on last edited by
          #4

          I figured it out, but thanks anyway ______________________________________________ "I'm not me when I dream...anymore." -TRUSTcompany

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups