Thread: visual basic mod function problems

  1. #1
    Registered User
    Join Date
    Mar 2012
    Posts
    1

    visual basic mod function problems

    Hey im kind of new to visual basic and pretty much all programing, but here is what I have to do. I have to make a calculator that will calculate the day of the week after the user enters the month, day of the month, and the year. I have everything good to go but i am having problems with the leap year test. I'm not completely sure how to use the mod function, and I cant find much info on it online; basically this is what i have for it but it does not seem to be working. Y is the variable for the year that the user selects.

    If (Y Mod 400 = True and Y Mod 100 = True) Then
    For feb2 = 1 To 29
    Select Case ListBox1.SelectedItem
    Case ("Febuary")
    ListBox2.Items.Add(feb2)
    Y = ListBox3.SelectedItem
    End Select

    Next
    End If

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    Perhaps you should try joining a forum which specifically mentions "visual basic" somewhere in the title.

    We deal with C, C++, C# here.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User ledow's Avatar
    Join Date
    Dec 2011
    Posts
    435
    Completely the wrong place to ask. But Mod returns the modulus - i.e. the remainder after dividing by whatever. X Mod 400 will return the remainder after dividing by 400. So 801 Mod 400 is 1, for instance. Not True/False.

    - Compiler warnings are like "Bridge Out Ahead" warnings. DON'T just ignore them.
    - A compiler error is something SO stupid that the compiler genuinely can't carry on with its job. A compiler warning is the compiler saying "Well, that's bloody stupid but if you WANT to ignore me..." and carrying on.
    - The best debugging tool in the world is a bunch of printf()'s for everything important around the bits you think might be wrong.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Visual Studio DLL and Visual Basic
    By mathguy in forum C Programming
    Replies: 18
    Last Post: 12-08-2011, 03:55 PM
  2. Replies: 3
    Last Post: 07-19-2008, 03:12 PM
  3. what is the difference between procedural and function in Visual basic?
    By Mitchell in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 06-24-2002, 10:05 AM
  4. Replies: 1
    Last Post: 04-20-2002, 06:49 AM
  5. Moving from Visual Basic to Visual C++
    By Unregistered in forum C++ Programming
    Replies: 3
    Last Post: 04-10-2002, 09:57 PM

Tags for this Thread