SemiCRC – A fast CRC-like algorithm
‘ Evaluate the 16-bit Checksum of an array of bytesFunction SemiCRC(ByVal source() As Byte) As Integer Dim crc, temp As Integer, i As Long Const divisor As Integer = 32768
‘ Evaluate the 16-bit Checksum of an array of bytesFunction SemiCRC(ByVal source() As Byte) As Integer Dim crc, temp As Integer, i As Long Const divisor As Integer = 32768
‘ Display the “Open with…” dialog and open the specified file with the ‘ selected program’ Example: ShowOpenWithDialog(“d: est.txt”) Shared Function _ ShellExecute(ByVal hwnd As Integer, ByVal lpOperation As String,
‘ Increment the numeric right-most portion of a string’ Example: MessageBox.Show(IncrementString(“test219”)) ‘ => 220Function IncrementString(ByVal text As String) As String Dim index As Integer Dim i As Integer For i
You can easily execute a SQL Server 7.0 Data Transformation Services (DTS) package from VB remotely: Create a DTS package. It can be an import from Excel into SQL Server.
When creating a project or Web page, you sometimes need to use characters not included on your keyboardfor example, Related Posts How Can You Improve App Performance for a Better
You use quotation marks in VB to define strings, but how do you include them in your output? Use whichever of these methods works the best for you: Dim strUseChr
Users often complain that listboxes don’t have the same multiple keypress search capabilities as treeviews and other objects. But you can simulate this behavior by adding code to a form
You can move a transaction log using SQL Server stored procedures. Simply detach the database, move the log file, then reattach the database. For example, to move the pubs database
VB’s Add File dialog supports only a single selection of code modules or OCXs, so you must painstakingly select each individual file and control one at a time. One of
Converting an integer to a string is a very common programming task. The most popular method for doing this are to use either String.valueOf(int) or Integer.toString(). Which one is better
Say you want to store data for temporary use in a program. You will have to declare variables to input the data. Luckily, declaring variables in C++ is very easy.
Frequently Asked Questions Selected News Readers Selected News Aggregators More RSS Resources Take me directly to the feeds! 1. Frequently Asked Questions What are DevX feeds? DevX offers access to
Typically, you read and process a text file by using a loop and VB’s Line Input statement: Do While Not Eof(1) Line Input #1, myStringVar$ ‘ process the line hereLoop
xperience suggests the working life of applications is enhanced if developers acknowledge the inherent requirements of standards-based development. For instance, if an application is based on emerging or evolving technology,
This can be accomplished with just one line of code: FindEOM = DateSerial(Year(ADate), Month(ADate) + 1, 0) Setting the day parameter of DateSerial to 0 always returns the day prior
This procedure retrieves the table name, table id, column or fieldname, data type, the length of the field in bytes, and the order in which the fields were created. I
Use this stored procedure to send an email: DECLARE @SenderAddress varchar(100)DECLARE @RecipientAddress varchar(100)DECLARE @Subject varchar(200)DECLARE @Body varchar(8000)DECLARE @oMail int –Object referenceDECLARE @resultcode intSET @SenderAddress = ‘[email protected]’SET @RecipientAddress= ‘[email protected]’SELECT @Subject =
Use this code to change the read-only permissions of a file in JDK 1.2.2: public void changeFilePermission(){ String osName = System.getProperty(“os.name”); try{ if (osName.equalsIgnoreCase(“WINDOWS NT”) ||osName.equals(“Windows 2000”) ) { Runtime.getRuntime().exec(“cmd.exe
JavaScript doesn’t have a trim to strip the spaces around strings. This little bit of code uses regular expressions to strip the spaces around given input. function trim(input){ var lre
It has been stated before that hard-coded, literal strings are to be avoided. I disagree. There is an easy, convenient way to handle hard-coded, literal strings: use a macro directly
SS (Really Simple Syndication) feeds are an easy way for organizations to distribute content. At the most basic level, an RSS feed, or channel, is an XML document containing a
DIV Example Click to turn this text red. Related Posts Actor Justin Long promotes Qualcomm laptopsGet a User that has Deleted Rows with SQLCheck for finite numbers in PythonHPE, Micro
Use the following code to scale an image into double its original size: import java.applet.*;import java.awt.*;import java.net.*;public class ScaleImage extends Applet{ Image img; public void init() { try { img
‘ Format a date as a DateSerial for Access’ Example: Debug.Print GetDBDate(date)Public Function GetDBDate(sDate As String) As String On Error GoTo ERROR_GetDBDate Dim sTmp As String If IsDate(sDate) = False
‘ Returns a string between 2 delimiters’ Parameters:’ sSearchIn: String to search’ sFrom: First keyword’ sUntil: Second keywords’ nPosAfter: Gets the position after” Example:’ Debug.Print GetStringBetweenTags(“This is a sample of
Private Declare Function GetProfileString Lib “kernel32” Alias _ “GetProfileStringA” (ByVal lpAppName As String, ByVal lpKeyName As String, _ ByVal lpDefault As String, ByVal lpReturnedString As String, _ ByVal nSize As
‘ Generates all combination possibilities out of a stringPublic Function PermuteString(ByVal Ztring As String, Optional Base As String = _ “”) As String Dim TmpStrArray() As String, I As Long
To save to file the graph generated by a MSChart control, you must use the control Related Posts Dinosaur fossils discovered in northern B.C. mountainsUse Yield Instead of a List
By editing the Registry it is possible to change the icon that Windows Explorer uses for a drive. For example, if you want to change Drive E’s icon, create the
n graphical user interfaces such as Microsoft Windows, drawing on the screen is an important task. Everything displayed on the screen is based on simple drawing operations. Often, environments such