January 27th, 2007
End Statement Str Function Class Microsoft.VisualBasic.Conversion Syntax Str(number) number Use: Required Data Type: Numeric Any valid numeric expression or expression capable of conversion to a number Return Value A String representation of number Description Converts number from a numeric to a string Rules at a Glance If the conversion of number to a string cannot be made, an InvalidCastException error occurs. To prevent this, you can check the value of number by passing it to the IsNumeric function before calling Str. If number is not a numeric value or is not capable of conversion to a number (so that it can in turn be converted to a string), an InvalidCastException exception occurs. If the return value is positive, the Str function always includes a leading space in the returned string for the sign of number. Programming Tips and Gotchas Use the LTrim function to remove the leading space that the Str function adds to the start of the returned string. Both the CStr and Format functions have now superceded the Str function. The CStr function does not add a leading space for the sign of a positive number. Both the CStr and the Format functions are internationally aware, able to recognize decimal delimiters other than the period (.). See Also CStr Function
Note: If you are looking for cheap and inexpensive provider to host and run your tomcat application check professional tomcat hosting services
Posted in vb | No Comments »
January 26th, 2007
both Var1 and Var2 are variants rather than strings. In VB .NET, the type declaration applies to all undeclared variables since the last explicit type declaration. So the previous statement in VB .NET would cast Var1, Var2, and Var3 as strings. In VB 6, declaring and initializing variables are separate steps; aside from allowing VB to assign variables their default values, variables cannot be initialized at the same time they are declared. In VB .NET, variables can be assigned an initial value when they are declared. VB 6 allowes you to declare fixed-length strings; they are not supported, however, in VB .NET. VB 6 allows you to define the lower bound of an array when it is initialized. In VB .NET, all arrays have a lower bound of 0. Hence, the VB 6 syntax: Static array(1 To 20) As String is not supported in VB .NET. In VB 6, arrays are either fixed length or dynamic; in VB .NET, all arrays are dynamic. In VB 6, it is possible to define a procedure or a function as Static, meaning that all local variables defined in that routine are static. In VB .NET, the use of the Static keyword with the Function or Sub statements is not supported. See Also Dim Statement Stop Statement Syntax Stop Description Suspends program execution Rules at a Glance There is no limit to the number and position of Stop statements within procedures. The Stop statement acts like a breakpoint placing the program in break mode and highlighting the current line in the development environment allowing you to step through the code line by line. Programming Tips and Gotchas Stop is intended primarily for use in the design-time environment, where it suspends program execution without terminating it. In the runtime environment, however, Stop will cause the debugger to be invoked. Unlike the End statement, Stop does not explicitly close any open files or clear any variables, except in a compiled executable. See Also
Hint: If you are looking for high quality webhost to host and run your jsp application check Vision web hosting jsp services
Posted in vb | No Comments »
January 26th, 2007
When multiple variables are declared on the same line, if a variable is not declared with a explicit type declaration, then its type is that of the next variable with an explicit type declaration. Thus, in the line: Static x As Long, i, j, k As Integer, s As String the variables i, j, and k have type Integer. (In VB 6, the variables i and j would have type Variant.) When a static variable is initialized on the same line as its declaration, the initialization process is performed only the first time the declaration line is encountered. (Otherwise, the variable would not be static.) VB .NET permits the initialization of variables in the same line as their declaration (at long last!). Thus, we may write: Static x As Integer = 5 to declare an Integer variable and initialize it to 5. Similarly, we can declare and initialize more than one variable on a single line: Static x As Integer = 6, y As Integer = 9 Variables that are not explicitly initialized by the Static statement have the following default values: Data type Initial value All numeric types 0 Boolean False Date 01/01/0001 12:00:00 AM Decimal 0 Object Nothing String Zero-length string (”") Static variables can have procedure-level scope or block-level scope. Static variables with procedure-level scope last the lifetime of the application, but they are accessible only within the procedure in which they are defined. Static variables with block-level scope last the lifetime of the application, but they are accessible only within the code block (such as a looping construct or an If statement) in which they are defined. Programming Tips and Gotchas It is a recognized programming practice when using the Static statement in a procedure to put the Static statement at the beginning of that procedure. Although their value persists between calls to a procedure, Static variables do not have scope outside of the procedure in which they are created. For more on static variables, see Chapter 2. VB .NET/VB 6 Differences When multiple variables are declared on a single line of code in VB 6, variables not explicitly assigned a data type are cast as variants. For example, in the statement: Static Var1, Var2, Var3 As String
Hint: This post is supported by Gama php5 hosting services
Posted in vb | No Comments »
January 26th, 2007
Data Type: Any The name of the variable, following Visual Basic naming conventions subscripts Use: Optional Data Type: Integer Denotes varname as an array and specifies the dimension and upper bounds of the array New Use: Optional Type: Keyword Used to automatically create an instance of the object referred to by the object variable, varname type Use: Optional Type: Keyword Data type of the variable varname Description Used at procedure level to declare a Static variable and to allocate the relevant storage space in memory. Static variables retain their value between calls to the procedure in which they are declared. Rules at a Glance A Static variable’s scope is limited to the procedure in which it is created. The subscripts argument has the following syntax: upperbound [, upperbound] Using the subscripts argument, you can declare up to 60 multiple dimensions for the array. The New keyword specifies that a new instance of the object will be created. Use of the New keyword in the Static statement therefore eliminates the subsequent need to instantiate the object. You cannot use the New keyword to declare variables of any intrinsic data type or to declare instances of dependent objects. If you don’t use the New keyword with an object variable, you must use an assignment statement to assign an existing object to the variable before you can use the variable. datatype may be Boolean, Byte, Char, Date, Decimal, Double, Integer, Long, Object, Short, Single, String, a user-defined type, or an object type. If you don’t specify datatype, the variable will be cast as an Object.
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
Posted in vb | No Comments »
January 26th, 2007
None Description Places an Object on the top of the stack Rules at a Glance The Push method adds an item to the top of the stack and increases the Count property by 1. Stack.ToArray Method Class System.Collections.Stack Syntax stackvariable.ToArray( ) Return Value An Array of type Object Description Creates an array of type Object, copies the elements of the stack in order, and then returns the array Programming Tips and Gotchas Unlike the CopyTo method, the ToArray method does not require that we define an array in advance. However, we cannot specify the starting array index for the copy procedure. See Also Stack.CopyTo Method Static Statement Syntax Static varname[([subscripts])] [As [New] type] _ [,varname[([subscripts])] [As [New] type]] . . . varname Use: Required
Hint: If you are looking for good and high quality web space to host and run your java application check Vision java web hosting services
Posted in vb | No Comments »
January 25th, 2007
Class System.Collections.Stack Syntax stackvariable.Pop( ) Return Value Object Description Removes the top item from the stack and returns it as an Object Rules at a Glance Pop removes the top item from the stack and decrements the Count property by one. Pop generates an error if applied to an empty stack. Thus, it’s advisable to determine when a stack is empty by using the Count property before popping the stack. Programming Tips and Gotchas The Peek method returns a reference to the object at the top of the stack, but unlike the Pop method, does not remove it from the stack. See Also Stack.Clear Method, Stack.Peek Method Stack.Push Method Class System.Collections.Stack Syntax stackvariable.Push(obj) obj Use: Required Data Type: Object The item to place in the stack Return Value
Note: If you are looking for inexpensive but high quality provider to host and run your serlvet application check Astra servlet hosting services
Posted in vb | No Comments »
January 25th, 2007
Class System.Collections.Stack Syntax stackvariable.Count( ) Return Value Integer Description This read-only property returns an Integer specifying the number of elements in the stack. Stack.Peek Method Class System.Collections.Stack Syntax stackvariable.Peek( ) Return Value Object Description Returns the first item in the stack as an Object, but does not remove it from the stack Programming Tips and Gotchas The Peek method is similar to the Stack object’s Pop method, except that it leaves the stack intact. See Also Stack.Pop Method Stack.Pop Method
Hint: If you are looking for high quality webhost to host and run your jsp application check Vision web hosting jsp services
Posted in vb | No Comments »
January 25th, 2007
Array to which to copy the stack’s objects index Use: Required Data Type: Integer The index of the first array element to receive an element of the stack Return Value None Description Copies the stack elements into an array, starting at a specified array index Rules at a Glance The array can be of any data type that is compatible with the stack elements. Thus, for instance, we cannot use an Integer array to hold stack elements that are strings (that is, Objects whose subtype is String). The array must be sized to accommodate the elements of the stack prior to calling the CopyTo method. Example Public Sub Main ‘ Define a new stack Dim s As New Stack( ) Dim aStack( ), oItem As Object ‘ Push some items onto stack s.Push(”Chopin”) s.Push(”Mozart”) s.Push(”Beethoven”) ‘ Size the array and copy to it Redim aStack(s.Count - 1) s.CopyTo(aStack, 0) For Each oItem in aStack Console.WriteLine(oItem) Next End Sub See Also Stack.ToArray Method Stack.Count Property
Hint: If you are looking for high quality webhost to host and run your jsp application check Vision web hosting jsp services
Posted in vb | No Comments »
January 25th, 2007
Class System.Collections.Stack Syntax stackvariable.Contains(obj) obj Use: Required Data Type: Any The value to search for in the stack Return Value Boolean (True or False) indicating whether obj is found in the stack Description Returns a Boolean indicating whether a given element (Object) is somewhere in the stack Rules at a Glance obj must correspond exactly to an item in the stack for the method to return True. String comparison is case sensitive and is not affected by the setting of OptionCompare. The Contains method searches the stack sequentially. In other words, its performance is inversely proportional to the number of items in the stack. Programming Tips and Gotchas In comparing objects in the stack with obj, the Contains method in turn calls the BCL’s Object.Equals method to perform the comparison. The Equals method returns True if two object instances are the same instance. Stack.CopyTo Method Class System.Collections.Stack Syntax stackvariable.CopyTo(array, index) array Use: Required Data Type: Array of Objects
Note: If you are looking for reliable and quality webspace company to host and run your servlet application check professional servlet hosting services
Posted in vb | No Comments »
January 24th, 2007
s.Push(”Chopin”) s.Push (”Mozart”) s.Push (”Beethoven”) ‘ Is an item in the stack? MsgBox(”Beethoven in stack: ” & CStr(s.Contains(”Beethoven”))) ‘ Peek at the first (top) item on the stack MsgBox(”First item in stack is: ” & s.Peek.ToString) ‘ Send stack to an array and display all items Dim s() As Object = s.ToArray( ) Dim i As Integer For i = 0 To UBound(s) Debug.WriteLine(CStr(s(i))) Next ‘ Clear stack s.Clear( ) VB .NET/VB 6 Differences The Stack object is new to the .NET Framework. See Also Collection Class, Hashtable Class, Queue Class Stack.Clear Method Class System.Collections.Stack Syntax stackvariable.Clear( ) Return Value None Description Removes all entries from the stack. See Also Stack.Pop Method Stack.Contains Method
Note: If you are looking for cheap and quality provider to host and run your java application check Astra java hosting services
Posted in vb | No Comments »