File Putfilenumber value[ recordnumber File Getfilenumber value[ recordnumber

These functions are used for writing records to and reading records from a random-access file. Both functions need know the record number you want to access (write or read). The record_number argument is the number of the record we are interested in, and value is a record variable that is written to the file. The record_number argument is optional if you omit it, the record will be written to the current record position. After a record is written to or read from the file, the next record...

File Opennumber path mode[ access[ share[ recordLen

To use a file, you must first open it or create it, if it doesn't already exist. The FileOpen() function, which opens files, accepts a number of arguments, most of which are optional. The FileOpen() function replaces the Open statement of VB6, which is no longer supported in The argument path is the path of the file to be opened, and number is a number you assign to the file (usually through the FreeFile function). The mode argument determines the mode in which the file will be opened and can...

Format Currencyexpression[ numDigits AfterDecimal [ includeLeading Digit[ useParens ForNegative Numbers[ groupDigits

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...

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...

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...

Vrate 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...

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...

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...