Date/Time
 

Date/Time


These functions are pretty self-explanatory so I've not added any extra comments to them.




    • Date - Gets the current date
    • Time - Gets the current time
    • Now - Gets the current date and time
    • Timer - Returns the number of seconds since midnight 
    •  DateAdd - Adds a time interval to a date
    •  DateDiff - Returns how many time intervals there are between two dates
    •  DateSerial - Returns the month/day/year
    •  DateValue - Returns the date
    • Year - Returns the current year
    • Month - Returns the current month (integer)
    •  MonthName - Returns the text of the name of a month
    • Day - Returns the current day
    • Hour - Returns the current hour
    • Minute - Returns the current minute
    • Second - Returns the current second
    •  TimeSerial - Returns a date with the hour/minute/second
    •  TimeValue - Returns the time
    •  WeekDay - Returns the current day of the week (integer)
    •  WeekDayName - Returns the text of a day of the week

Miscellaneous




    •  MsgBox - A built-in dialog box that gives a message and allows a user input

      •  i  = msgbox "Read this!", vbokonly, "Test Message"

    •  DoEvents - Allows VB to complete pending tasks

      •  doevents

    • Shell - Executes a 2nd program from within the current program

      • shell "notepad.exe"
      • Note - VB does not wait for the Shell'd program to quit before executing the next line of code!

    • Command - Gives any text that followed a VB .EXE execution command

      • temp$ = command

    • Environ - Returns the system environmental space content

      • temp$ = environ

    • Beep - Makes the computer beep once.

      • beep

    •  InputBox - A built-in dialog box that allows entry of a text string

      •  inputbox  "Input a value!", 5

    •  AddressOf - Provides an entry point for an external program to use a procedure

      •  AddressOf  ( procedurename )

    •  AppActivate - Activates an applications window

      •  AppActivate  ( windowtitle )

    •  RaiseEvent - Fires an event declared at module level

      •  RaiseEvent  ProcedureName

    • Load - Load an object

      • load form1

    • Unload - Unload an object

      • Unload form1

    •  LoadPicture - Load a picture into a control property

      • form1.picture = loadpicture (filename)

    •  SavePicture - Save a picture to a file

      •  SavePicture (form1.picture,filename)

    •  LoadResData - Load the data from a resource file

      •  LoadResData (index,format)

    •  LoadResString - Load a string from a resource file

      •  LoadResString ( index,format)

    •  SendKeys - Send keys to another app as though they were from the keyboard

      •  Sendkeys  {DOWN}

    •  QBColor - Returns a value corresponding to the original QB values 0-15

      • form1.backcolor = QBcolor (12)

    • RGB - Returns a color value by inputting the red, green, and blue parts

      • form1.backcolor = RGB (12,128,256)

    • Me - Refers to the current object, usually the active form

      • print Me.caption

(c) Shilpa Sayura Foundation 2006-2017