Atlanta Custom Software Development 

 
   Search        Code/Page
 

User Login
Email

Password

 

Forgot the Password?
Services
» Web Development
» Maintenance
» Data Integration/BI
» Information Management
Programming
VB VB (1648)
VB.net VB.net (736)
C# C# (15)
ASP.net ASP.net (779)
ASP ASP (41)
VC++ VC++ (25)
PHP PHP (0)
JAVA JAVA (4)
JScript JScript (5)
  Database
» SQL Server (708)
» ORACLE (5)
» MySQL (0)
» DB2 (0)
Automation
» C/C++/ASM (11)
» Microcontroller (1)
» Circuit Design (0)
OS/Networking
» Networking (5)
» Unix/Linux (1)
» WinNT/2k/2003 (8)
Graphics
» Flash (0)
» Maya (0)
» 3D max (0)
» Photoshop (0)
Links
» ASP.net (2)
» PC Interfacing (1)
» Networking (4)
» SQL Server (4)
» VB (23)
» VB.net (4)
» VC (3)
» HTML/CSS/JavaScript (10)
Tools
» Regular Expr Tester
» Free Tools

(Page 2 of 2) 52 Result(s) found 

 

Static Variables are slower than Dynamic ones
Total Hit (2500) Referencing a static local variable in a procedure is 2-3 times slower than a regular local, dynamic variable; if you want to really speed up your procedures, convert all static variables into module-level variables. The only drawback to this approach is that the procedure become less self-conta ....Read More
Rating
Terminate the process with an ErrorLevel code
Total Hit (2355) If your VB application is meant to be called from within a Ms-Dos batch file, you must be able to return Dos an error code. This can be accomplished using the ExitProcess API function: «Code LangId=1» Private Declare Sub ExitProcess Lib "kernel32" (ByVal uExitCode As Long) ' terminate the pro ....Read More
Rating
Testing a key in a PropertyBag without raising an error
Total Hit (1948) When you pass a non-existing key to the WriteProperty method of the PropertyBag object you get an error 327 "Data value named 'namekey' not found". This is more or less the same error - albeit with a different error code - that you receive when you pass an non-existing key to the Item method of a Co ....Read More
Rating
The "Assume No Aliasing" compiler option
Total Hit (1804) A procedure is said to contain aliased values if it can refer to the same memory addresses in two or more distinct ways. A typical example is the following procedure: «Code LangId=1» Dim g_GlobalVariable As Long ... Sub ProcWithAliases(x As Long) x = x + 1 g_GlobalVariable = g_GlobalV ....Read More
Rating
Use ActiveControl to stop a loop
Total Hit (1844) Often your user interface includes fields whose contents mutually depends on other fields. A typical example is when you deal with conversions from one measurement unit to another. Let's say that you want to let your users enter a temperature either in Celsius or Fahrenheit degrees, so you provide t ....Read More
Rating
Use function name as a local variable
Total Hit (1965) Many programmers don't realize that it is perfectly legal to use the name of a function inside the Function itself, as if it were a local variable. This trick often lets you avoid the declaration of a temporary variable, and sometimes can speed up the code. Take for example the following code: « ....Read More
Rating
Use the right type for constants
Total Hit (1832) VB stores symbolic and literal constants internally using the simplest data type possible; this means that most common numeric constants-such as zero or one-are stored as Integers. If you use these constants in floating point expressions you can speed up your code using a constant of appropriate typ ....Read More
Rating
Write concise code with Boolean expressions
Total Hit (1989) When setting a Boolean value based upon the result of an expression, avoid using an unnecessary If/Then/Else structure. «Code LangId=1» 'Instead of using this lengthy syntax . . . If SomeVar > SomeOtherVar Then BoolVal = True Else BoolVal = False End If 'Use this one, which is easi ....Read More
Rating
Write concise code with the Choose function
Total Hit (1822) The Choose function lets you often make more concise, albeit not faster, code, because it lets you replace a lengthy Select Case block. For example, the following code: «Code LangId=1» Select Case index Case 1 result = 100 Case 2 result = 250 Case 3 resu ....Read More
Rating
Write concise code with the IIf function
Total Hit (1461) Use IIf when setting a value based upon an expression. This works only in situations where you have two choices, based upon the result of a Boolean expression. «Code LangId=1» 'long way If Var1 > Var2 Then Var3 = Var1 / Var2 Else Var3 = Var2 / Var1 End If 'this is more concise Var ....Read More
Rating
Write concise code with the InStr function
Total Hit (1510) You can often use the Instr function in an unorthodox way to write more concise code. A typical example is when you need to test a single character: «Code LangId=1» ' test whether CHAR contains a vowel ' the standard way If UCase$(char) = "A" Or UCase$(char) = "E" Or UCase$(char) = "I" Or UCas ....Read More
Rating
Write concise code with the Switch function
Total Hit (1094) Many VB developers don't realize that the Switch built-in function can often save a lot of code. This function takes any number of (expr, value) pairs, it evaluates all expressions and return the value related to the first expression that is found to be True. Typically you can use a Switch function ....Read More
Rating
Write concise code: a collection of simple tips
Total Hit (1560) If you fully understand how VB and VBA work, you can often save some statements. This makes your listings more concise and more readable, and indirectly optimizes your program. Here is a short list of the many tricks you can use with this goal. You don't need to initialize a numeric variable to 0 or ....Read More
Rating
CompareValue - Check whether a value is in a list of values
Total Hit (1292) «Code LangId=1»' Compares a numeric or string value with a list of other values. ' Returns the 1-based index of the matching value, or zero if the ' value doesn't appear in the list. ' String comparisons are case-sensitive. ' ' This function can conveniently replace a Select Case or a list ' ....Read More
Rating
KeepInRange - Ensure that a value is in a given range
Total Hit (1089) «Code LangId=1»' Keep the first argument in the range [lowLimit, highLimit] ' If the value is adjusted, the fourth (optional) argument is set to True ' ' Note that value and limit arguments are variant, so you can use ' this routine with any type of data. Function KeepInRange(value As Varian ....Read More
Rating
NZ - Check whether a value is Null
Total Hit (1188) «Code LangId=1»' Check if a value is Null. If not it returns the value, ' otherwise it returns the ValIfNull argument, or zero/null string ' if the second argument is omitted ' ' This function is patterned after the Access function with the same name. Public Function NZ(CheckVar As Varian ....Read More
Rating
ProjectName - The name of the current project
Total Hit (1120) «Code LangId=1»' Returns the name of the current project ' The first time it's called it clears the error code ' Function ProjectName() As String Static result As String If Len(result) = 0 Then On Error Resume Next ' cause a dummy, harmless error Err.Raise 9 ....Read More
Rating
RunningAsExe - Determine whether the code is running in an EXE or DLL
Total Hit (1424) «Code LangId=1»Private Declare Function GetModuleFileName Lib "kernel32" Alias _ "GetModuleFileNameA" (ByVal hModule As Long, ByVal lpFileName As String, _ ByVal nSize As Long) As Long Function RunningAsEXE() As Boolean Dim filePath As String ' get the name of the curre ....Read More
Rating
This is a link to a different site Dealing with Circular References
Total Hit (1174) VB and COM makes a lot of things easy to do, particularly using and dealing with objects: you just create them and normally they clear themselves up automatically once you're finished with them. However, one side effect of the way COM works is that it is possible to create objects which cannot termi ....Read More
Rating
This is a link to a different site Implementing Unsigned Right and Left Shift Operators
Total Hit (857) When translating C code to VB, often you come across the Right Shift and Left Shift operators ( << and >> respectively ). There is no inbuilt support for Right and Left Shift in VB, so you have to code your own. One of the main problems with replacing these functions is that C code often uses them i ....Read More
Rating
This is a link to a different site HiWords and LoWords from Long Values
Total Hit (505) When translating C code to VB, you quite often come across the HiWord and LoWord operators, used to pack two integers into a long value. A simple translation of HiWord code will run into difficulties when unsigned integer arithmetic is being used in the C code and the highest bit of the long value c ....Read More
Rating
This is a link to a different site Tutorial : Programming in Visual Basic
Total Hit (620)
Rating


(Page 2 of 2) 52 Result(s) found  1 2

Recommanded Links

 

Home   |  Comment   |  Contact Us   |  Privacy Policy   |  Terms & Conditions   |  BlogsZappySys

© 2008 BinaryWorld LLC. All rights reserved.