Archive for December, 2006

50 is in interval 50: 59 55 is (Web hosting shopping cart)

Sunday, December 31st, 2006

50 is in interval 50: 59 55 is in interval 50: 59 60 is in interval 60: 69 65 is in interval 60: 69 70 is in interval 70: 79 75 is in interval 70: 79 80 is in interval 80: 89 85 is in interval 80: 89 90 is in interval 90: 99 95 is in interval 90: 99 100 is in interval 100:100 105 is in interval 101: 110 is in interval 101: Programming Tips and Gotchas The Partition function is useful in creating histograms, which give the number of integers from a collection that fall into various ranges. VB .NET/VB 6 Differences The Partition function is new to VB .NET. Pi Field Class System.Math Syntax Math.PI Return Value A Double containing the approximate value of the irrational number pi Description This field returns the approximate value of the irrational number pi. In particular: Math.PI = 3.14159265358979 Rules at a Glance This is a Shared member, so it can be used without creating any objects. VB .NET/VB 6 Differences The Pi field is new to VB .NET.

Hint: This post is supported by Gama web hosting php services

Data Type: Long Size of each interval into

Sunday, December 31st, 2006

Data Type: Long Size of each interval into which the range is partitioned. Return Value A String containing the range within which number falls Description Returns a string that describes which interval contains the number Rules at a Glance start must be greater than or equal to 0. stop cannot be less than or equal to start. Partition returns a range formatted with enough leading spaces so that there are the same number of characters to the left and right of the colon as there are characters in stop, plus one. This ensures that the interval text will be handled properly during any sort operations. If number is outside of the range of start, the range reported is: : (start - 1) If number is outside the range of end, the range reported is: (last_end_range + 1): If interval is 1, the range is number:number, regardless of the start and stop arguments. For example, if interval is 1, number is 100, and stop is 1000, Partition returns 100:100. If any of its arguments are Null, Partition returns a Null. Example The code: Dim i As Integer For i = -1 To 110 5 Debug.WriteLine(CStr(i * 5) & ” is in interval ” & _ Partition(i * 5, 0, 100, 10)) Next produces the following output: -5 is in interval : -1 0 is in interval 0: 9 5 is in interval 0: 9 10 is in interval 10: 19 15 is in interval 10: 19 20 is in interval 20: 29 25 is in interval 20: 29 30 is in interval 30: 39 35 is in interval 30: 39 40 is in interval 40: 49 45 is in interval 40: 49
Note: If you are looking for reliable and quality webspace company to host and run your servlet application check professional servlet hosting services

In both cases, true (Sbc web hosting) corresponds to OptionExplicitOn, and

Sunday, December 31st, 2006

In both cases, true corresponds to OptionExplicitOn, and false corresponds to Option Explicit Off. VB .NET/VB 6 Differences The OptionStrict setting is new to VB .NET. See Also Option Explicit Statement Partition Function Class Microsoft.VisualBasic.Interaction Syntax Partition(number, start, stop, interval) number Use: Required Data Type: Long Number to evaluate against the intervals. start Use: Required Data Type: Long Start of the range. Must be non-negative. stop Use: Required Data Type: Long End of the range. Must be greater than start. interval Use: Required
Note: If you are looking for top 10 and very good webhost to host and run your jsp application check Actions jsp hosting services

StrictOn would still not (Verizon web hosting) allow the conversion and

Sunday, December 31st, 2006

StrictOn would still not allow the conversion and would instead generate a compiler error. The reasoning here is that, although particular narrowing operations may not lose data, there is always the potential for data loss when working with variables that is, with symbolic representations of numbers whose values are allowed to vary. Rules at a Glance If the OptionStrict statement is not present in a module, OptionStrict is Off. The default is OptionStrictOn. In other words, the statement: Option Strict On is equivalent to the statement: Option Strict The OptionStrict statement must appear in the declarations section of a module before any code. Option Strict On disallows all implicit narrowing conversions. OptionStrictOn also causes errors to be generated for late binding, as well as for any undeclared variables, since OptionStrictOn implies OptionExplicitOn. Programming Tips and Gotchas Although the setting of OptionStrict has no effect on BCL data types, BCL data types disallow implicit narrowing conversions. Explicit narrowing conversions are not affected by OptionStrict. However, if data loss does occur as a result of an explicit conversion, an OverflowException exception is generated. One of the most commonly overlooked narrowing conversions is the use of “wider” arguments in function, procedure, and method calls. Passing a Long to an Integer parameter, for example, is an implicit narrowing conversion that OptionStrict does not allow. In many cases, OptionStrictOn disallows seemingly “safe” conversions because it interprets literal values in unexpected ways. For example, the statement Dim decNum As Decimal = 10.32 generates a compiler error because 10.32 is interpreted as a Double, and implicit conversions from Double to Decimal are not allowed. You can correct this compiler error with a statement like: Dim decNum As Decimal = 10.32D Setting OptionStrictOn is highly recommended. For an ASP.NET page, you use the @Page directive rather than OptionStrict to control strict type checking. Its syntax is: <%@ Page Language="VB" Strict=true|false %> By default, Strict is false in ASP.NET pages. You can also use the section of the WEB.Config file to control strict type checking for an entire virtual directory or ASP.NET application by adding a strict attribute to the compilation section. Its syntax is:

Hint: If you are looking for very good and affordable webspace to host and run your j2ee hosting application check Sandzak.com j2ee web hosting services

Option Explicit On Programming Tips and Gotchas (Verizon web hosting)

Saturday, December 30th, 2006

Option Explicit On Programming Tips and Gotchas It is considered good programming practice to always use the OptionExplicit statement. The following example shows why: 1: Dim iVariable As Integer 2: iVariable = 100 3: iVariable = iVariable + 50 4: MsgBox iVariable In this code snippet, an integer variable, iVariable, has been declared. However, because the name of the variable has been mistyped in line 3, the message box shows its value as only 50 instead of 150. This is because iVarable is assumed to be an undeclared variable whose value is 0. If the OptionExplicit statement had been used, the code would not have compiled, and iVarable would have been highlighted as the cause. For an ASP.NET page, you use the @PAGE directive rather than OptionExplicit to require variable declaration. Its syntax is: <%@ Page Language="VB" Explicit=true|false %> By default, Explicit is true in ASP.NET pages. You can also use the section of the WEB.Config file to require variable declaration for an entire virtual directory or ASP.NET application by adding an explicit attribute to the compliation section. Its syntax is: In both cases, true corresponds to OptionExplicitOn, and false corresponds to Option Explicit Off. Option Strict Statement Syntax Option Strict [On | Off] Description OptionStrict prevents VB from making any implicit data type conversions that are narrowing since narrowing conversions may involve data loss. For example: Dim lNum As Long = 2455622 Dim iNum As Integer = lNum converts a Long (whose value can range from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807) to an Integer (whose value can range from 2,147,483,648 to 2,147,483,647). In this case, even though no data loss would result from the narrowing, Option
Note: If you are looking for best hosting provider to host and run your tomcat application check Astra tomcat hosting services

Web hosting paypal - Whereas the OpenFileDialog class is implemented in the

Saturday, December 30th, 2006

Whereas the OpenFileDialog class is implemented in the .NET Base Class Library, VB 6 offered the CommonDialog custom control. Although the two offer similar functionality, their public interfaces are almost completely different. Option Compare Statement Syntax Option Compare {Binary | Text} Description Used to set the default method for comparing string data Rules at a Glance When OptionCompare is not used in a module, the default comparison method is Binary. When OptionCompare is used, it must appear at the start of the module’s declarations section, before any procedures. Binary comparison the default text comparison method in Visual Basic uses the internal binary code of each character to determine the sort order of the characters. For example, “A” <"a". Text comparison uses the locale settings of the current system to determine the sort order of the characters. Text comparison is case insensitive. For example, "A"="a". Option Explicit Statement Syntax Option Explicit [On | Off] Description Use OptionExplicit to generate a compile-time error whenever a variable that has not been declared is encountered. Rules at a Glance The OptionExplicit statement must appear in the declarations section of a module before any procedures. In modules where the OptionExplicit statement is not used, any undeclared variables are automatically cast as Objects. The default is OptionExplicitOn. In other words, the statement: Option Explicit is equivalent to:
Hint: If you are looking for high quality webhost to host and run your jsp application check Vision web hosting jsp services

Multiselect property Sets or retrieves a Boolean value (Free speech web hosting)

Saturday, December 30th, 2006

Multiselect property Sets or retrieves a Boolean value indicating whether the user is allowed to select more than one file. OpenFile method Opens the file selected by the user, returning a Stream object. The file is opened in read-only mode. As Microsoft puts it: “The OpenFile method is used to provide a facility to quickly open a file from the dialog box. The file is opened in read-only mode for security purposes. To open a file in a read/write mode, you must use another call ” (See the “ShowDialog Method” entry.) ReadOnlyChecked property Sets or retrieves a Boolean value indicating whether the read-only check box is selected on the dialog box. RestoreDirectory property Gets or sets a Boolean value indicating whether the current directory is restored before the dialog closes. Its default value is False. ShowDialog method The OpenFileDialog class inherits from the FileDialog class, which in turn inherits from the CommonDialog class. This class has a ShowDialog method that shows the dialog box. Once the user has dismissed the dialog box, the FileDialog’s FileName and FileNames properties can be used to get the user’s choice(s). ShowReadOnly property Sets or retrieves a Boolean value indicating whether the dialog box contains a read-only checkbox. Title property Gets or sets a String value containing the title of the Open dialog box. Example The following code asks the user for one or more files and displays the filenames in the Output window: Dim fd As New OpenFileDialog( ) Dim i As Integer fd.Multiselect = True If fd.ShowDialog( ) = DialogResult.OK Then For i = 0 To UBound(fd.FileNames) Debug.WriteLine(fd.FileNames(i)) Next End If VB .NET/VB 6 Differences
Note: If you are looking for top 10 and very good webhost to host and run your jsp application check Actions jsp hosting services

Selected OpenFileDialog Members The following is a brief (Web hosting forums)

Saturday, December 30th, 2006

Selected OpenFileDialog Members The following is a brief description of some of the more important members of the OpenFileDialog class: AddExtension property Gets or sets a Boolean value that determines whether the default file extension is automatically added to the Filename property if the user fails to enter an extension. Its default value is True. CheckFileExists property Sets or retrieves a Boolean value indicating whether a warning message should be displayed if the user enters the name of a file that does not exist. The default value is True. DefaultExt property Gets or sets a String that defines the default file extension. The string should consist of the file extension only without a period. FileName property Returns a string that contains the fully qualified name (that is, complete path and filename) of the file selected by the user. If no file is selected, the property returns an empty string. FileNames property Returns a String array that contains the fully qualified names (that is, complete paths and filenames) of the files selected by the user. If no file is selected, the property returns an empty array. Note that this property returns a single-element array if the Multiselect property is False and the user selects a file. Filter property Gets or sets a String containing the current filter, which determines the items that appear in the “Files of type” drop-down listbox. A single item consists of a file description, a vertical bar, and the file extension (usually “*.” plus the file extension). If there are multiple extensions in a single item, they are separated by semicolons. If there are multiple items, they are separated by vertical bars. For example, the following code fragment assigns a filter string to a String variable: sFilter = oFS.Filter=”Text files (*.txt; *.vb)|*.txt;*.vb|” & _ “Visual Basic files (*.vb)|*.vb|” & _ “All files (*.*)|*.*” FilterIndex property Gets or sets an Integer value that determines which of the items defined by the Filter property are selected. The index is one-based, rather than zero-based. When the dialog is first displayed and no FilterIndex value is specified, it defaults to 1. When the method returns, its value indicates which filter item was selected by the user. InitialDirectory property Gets or sets a String that defines the directory initially displayed by the OpenFileDialog dialog
Hint: If you are looking for high quality webhost to host and run your jsp application check Vision web hosting jsp services

End Function Sub Test2( ) (Good web hosting)

Saturday, December 30th, 2006

End Function Sub Test2( ) On Error Goto Err_Test2 Test( ) Exit Sub Err_Test2: MsgBox(”Error handled”) End Sub When Test2 is run, the message “Error handled” is displayed. This indicates that the error that occurs in the error handler of Test is passed to Test2. For more on both unstructured and structured error handling, see Chapter 7 VB .NET/VB 6 Differences In VB 6, the label in OnErrorGoTo label can be either a label or a line number. In VB .NET, the use of line numbers is not supported. See Also Err Object OpenFileDialog Class Namespace System.Windows.Forms Createable Yes Description Represents a common dialog box for selecting or opening a file. The OpenFileDialog class has properties for setting the initial appearance and functionality of the file dialog box, a property for returning the filename or names selected by the user, as well as a method for showing the dialog box. An instance of the OpenFileDialog class does not itself open the file, but instead provides the information that allows your code to do this programmatically. Under VB, the most common use for this dialog box is to get the name of a file from the user, after which we can use VB’s functions to open that file. An OpenFileDialog object can be instantiated as follows: Dim oOpenDlg As New OpenFileDialog

Note: If you are looking for good and affordable webspace to host and run your servlet application check Sandzak servlet hosting services

Web hosting forum - generate an error. By using the OnErrorResumeNext statement,

Friday, December 29th, 2006

generate an error. By using the OnErrorResumeNext statement, you force your program to ignore this error and carry on with the next control. On Error Resume Next For Each Control In Me.Controls Control.Text = “” Next Use of the OnErrorResumeNext statement should be kept to a minimum, since errors are basically ignored and their occurrence is silent to the user. This means that, should an unexpected error (that is, an error that you were not intending to handle when you chose to ignore errors) occur or should your application behave unexpectedly, the job of finding and correcting the cause of the error becomes almost impossible. The following is a template for error handling within your procedures using the OnError statement: Sub/Function/Property Name ( ) On Error Goto Name_Err … ‘procedure code Name_Exit: … ‘tidying up code - such as Set Object = Nothing Exit Sub/Function/Property Name_Err: … ‘error handling code e.g. a MsgBox to inform the user Resume Name_Exit End Sub/Function/Property If cleanup code isn’t required within the procedure, you can simplify the template by removing the Name_Exit label and removing the ResumeName_Exit statement. If you are writing an error-handling routine for use within a class module or a DLL, you should use the following template, which raises an error back to the client, thereby notifying the client of the error and allowing the client to handle it: Sub/Function/Property Name ( ) On Error Goto Name_Err … ‘procedure code … ‘tidying up code - such as Set Object = Nothing Exit Sub/Function/Property Name_Err: … ‘error handling and tidying up code Err.Raise etc… End Sub/Function/Property Errors that occur within an error handler are passed up the call chain. To illustrate this, consider the following code: Public Function Test( ) As Integer On Error Goto Err_Test Dim iTest( ) As Integer = {1, 2} Test = iTest(3) ‘ error Exit Function Err_Test: MsgBox(iTest(4)) ‘ error
Note: If you are looking for top 10 and very good webhost to host and run your jsp application check Actions jsp hosting services