FormatCurrencyexpression[ numDigitsAfterDecimal [ includeLeadingDigit[
This function returns a numeric expression formatted as a currency value dollar amount using the currency symbol defined in Control Panel. All arguments are optional, except for the expression argument, which is the number to be formatted as currency. numDigitsAfterDecimal is a value indicating how many digits will appear to the right of the decimal point. The default value is 1, which indicates that the computer's regional settings must be used. includeLeadingDigit is a tristate constant that...
VBNET QBColorcolor
This function returns an Integer representing the RGB color code corresponding to the specified color number. The color argument is a number in the range 0 through 15. Each value returns a different color, as shown in Table 22. Table 22 Values for the color Argument Table 22 Values for the color Argument Use the QBColor function to specify colors if you want to address the needs of users with the least-capable graphics adapter one that can't display more than the basic 16 colors . Also use it...
AppActivatetitle[ wait
This function which does not return a value lets you activate an application that you started previously from within your VB code with the Shell function. The first argument, title, specifies the title of the application as it appears in the titlebar of the application's window . You can also use the ID of the application returned by the Shell function. The wait argument is optional it's a Boolean value that determines whether the calling application has the focus before activating another. If...
Print filenumber outputlist PrintLinefilenumber outputlist
The Print function writes data to a sequential file. The first argument is the number of the file to be written, and the following arguments are the values, or variables, to be written to the file. The second argument is a parameter array, which means you can pass any number of values to the function Print fNum, var1, var2, some literal, 333.333 The Print function doesn't insert line breaks between successive calls. The following statements write a single line of text to the file opened as fNum...
Ratenper pmt pv[ fv[ type[ guess
You use this function to figure out the interest rate per payment period for a loan. Its arguments are the same as with the preceding financial functions, except for the guess argument, which is the estimated interested rate. If you omit the guess argument, the value 0.1 10 is assumed. Table 18 lists and describes the remaining financial functions. All return values are Doubles. Table 18 Additional Financial Functions PV The present value of an investment NPV The net present value of an...
ChDirpath
The ChDir function changes the current folder directory . If your application opens many disk files, you can either specify the path name of each file, or switch to the folder where the files reside and use their names only. To switch to the folder C Windows, use the statement If the argument of the ChDir function doesn't include a drive name, then ChDir will attempt to switch to the specified folder on the current drive. If no such folder exists, then the current folder won't change and a...
Formatexpression[ format[ firstdayofweek[ firstweekofyear
This function returns a string containing an expression formatted according to instructions contained in a format expression. The expression variable is the number, string, or date to be converted, and format is a string that tells Visual Basic how to format the value. The string hh mm.ss, for example, displays the expression as a time string if the first argument is a date expression . The Format function is used to prepare numbers, dates, and strings for display. Atan 1 4 calculates pi with...
FVrate nper pmt[ pv[ type
This function returns the future value of a loan based on periodic, fixed payments and a fixed interest rate. The arguments of the FV function are explained in the IPmt entry, and the pmt argument is the payment made in each period. Suppose you want to calculate the future value of an investment with an interest rate of 6.25 , 48 monthly payments of 180, and a present value of 12,000. Use the FV function with the following arguments Dim PVal, FVal As Integer Dim APR, Payment As Double Dim...
MkDirpath
The MkDir function creates a new folder directory . The path argument can be the full path of the new folder, or just a folder name, in which case a new folder is created under the current folder. The statement MkDir C Users New User will create the New User folder under C Users, but only if the parent folder exists already. If C Users doesn't already exist, you must call the MkDir function twice, to create two folders, as shown next MkDir C Users MkDir C Users New User Alternatively, you can...
Rnd[seed
This function returns a pseudo-random number in the range 0 to 1. The optional argument is called a seed and is used as a starting point in the calculations that generate the random number. NOTE The sequence of random numbers produced by Visual Basic is always the same Let's say you have an application that displays three random numbers. f you stop and rerun the application, the same three numbers will be displayed. This is not a bug. It's a feature of Visual Basic that allows you to debug...
Midstring start[ length newstring
In addition to the Mid function, there's a Mid statement, which does something similar. Instead of extracting a few characters from a string, the Mid statement replaces a specified number of characters in a String variable specified with the first argument, string with another string the argument new_string . The location and count of characters to be replaced are specified with the arguments start and length. The last argument is optional. If you omit it, all the characters from the starting...
Shellpathname[ style[ wait[ timeout
This function starts another application and returns a value representing the program's task ID if successful otherwise, it returns zero. The path_name argument is the full path name of the application to be started and any arguments it may expect. The optional argument style determines the style of the window in which the application will be executed, and it can have one of the values shown in Table 24. Table 24 The AppWinStyle Enumeration Hide The window is hidden, and focus is passed to it....
Dir[pathname[ attributes
The Dir function accepts two optional arguments and returns a string with the name of a file or folder that matches the specified pathname or file attribute s . If you specify the first argument, which supports wildcard characters, Dir will return the name of the file or folder that matches the specification. If no file or folder matched the specification, an empty string is returned . The second argument is a numeric value, which specifies one or more attributes, from the enumeration shown in...
VBNET Functions and Statements
This bonus reference describes the functions and statements that are supported by Visual Basic .NET, grouped by category. When you're searching for the statement to open a file, you probably want to locate all file I O commands in one place. This is exactly how this reference is organized. Moreover, by grouping all related functions and statements in one place, I can present examples that combine more than one function or statement. The majority of the functions are the same as in VB6. One...