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

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

App Activatetitle[ 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 Print Linefilenumber 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...

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

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

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