Advertisement

Results for "Author: rde"

6_2008-2009 #213799
ArrPtr/StrArrPtr function for vb5 and vb6 (FIXED!)

This function returns a pointer to the SAFEARRAY header of any Visual Basic array, including a Visual Basic string array. Substitutes both ArrPtr and StrArrPtr. This function will work with vb5 or vb6 without modification. Normally you need to declare a VarPtr alias into msvbvm50.dll or msvbvm60.dll depending on the vb version, but this function will work with vb5 or vb6.

6_2008-2009 #213800
String array pointers fast caching technique

This is a simple string pointer caching technique that speeds up the testing of algorithms that manipulate string array pointers such are string sorting routines ... I found the most time consuming part of sort testing was the resetting of the test array before every test ... This is a solution that removes the need to re-assign strings into a test array before every test is started ... This module contains two sub-routines named CacheArrayPtrs and ResetArrayPtrs ... You call CacheArrayPtrs whenever the array is loaded with new items ... You call ResetArrayPtrs before every test and instantly be ready to test the original cached array ... Update 16 Oct 09 to correct an error in the documentation only ... Usage code included in 3kb zip.

6_2008-2009 #213801
A Better Synonym Checker Revisited

This is an extension of 'A Better Synonym Checker' submission by Zaphod that can be found at www.Planet-Source-Code.com/vb/scripts/ShowCode.asp?txtCodeId=32832&lngWId=1 ... His SynonymCheck method keeps M$ Word hidden, and does NOT require the M$ Word 9 Object Library ... This 4k class contains the following functions: GrammarCheck, SpellCheck, SynonymCheck, SpellCheckResults, SynonymCheckResults ... The last two do NOT display an M$ dialog box, but return an array of possible results ...

6_2008-2009 #213802
Array Basics (FIXED 18-Apr-08)

Array basics for beginners

6_2008-2009 #213803
Arithmetic operations on memory address pointers

Function to enable valid addition and subtraction of unsigned long integers. Treats the passed value as an unsigned long and returns an unsigned long. Allows safe arithmetic operations on memory address pointers. Assumes valid pointer and pointer offset. Rather fast too, has very small performance hit compared to unsafe in-line calculation, even in intensive loops. The code for addition came from PSC (LukeH) but I needed subtraction as well, thought I'd share. Confirmation that this produces valid results would be appreciated.

6_2008-2009 #213804
Fast Sub-String Count (aka InStrCount)

This function searches the passed string for occurences of the specified sub-string. It has the ability to make case-sensitive or case-insensitive searches. It can also perform whole-word-only matching ... This SubStrCount implementation offers extended functionality which allows it to be used in a similar way to other token style functions ... SubStrCount will return the number of matches or zero if none.

6_2008-2009 #213805
A ShellSort with a twist - Revised and even faster! (7 March 2009)

This shell algorithm is founded on a very solid performer that was originally developed by vb2themax, and optimized further by several very talented coders, before I twisted a little more out of it in this hybrid version. ---- This latest version employs a clever SAFEARRAY substitution technique to trick VB into thinking the four-byte string pointers in the string array are just VB longs in a native VB long array, and is now much faster. ---- Also uses valid addition and subtraction of unsigned long integers to guarantee safe arithmetic operations on memory address pointers. ---- Includes both Shell and ShellHyb algorithms with indexed versions in 25kb class and demo project. ---- Update 21 June 2008 inspired by comments from Roger Gilchrist. Improved indexed sorting support routine to better exploit fast re-sorting performance, and added much needed index sorting documentation. ---- Obscure Bug Fix 7 March 09. I documented they 'can sort sub-sets of the array data' but with the indexed versions if you do an error *could* occur without this very small change.

6_2008-2009 #213806
Addin Extensibility Quick Reference + Tutorials

Addin Extensibility Quick Reference + Tutorials The VB5/6 IDE exposes a powerful object model that lets you manipulate VB's environment. It gives you control of your projects, components, modules, procedures, and even individual lines of code. You can customize all the menus and toolbars of the environment; trap nearly every user action, such as adding a new component or renaming an old one; open, scroll, move, and close all the code windows ... All this power comes at a price, however: the extensibility object model is rather complex, and you must spend some time acquainting yourself with how it works ... Hopefully, this extensibility quick reference will help you familiarise yourself more quickly and offers this information in a handy code format ... Now includes some tips and a couple of small MSDN tutorials ... Please report any errors or omissions - happy coding.

6_2008-2009 #213807
Working with the Visual Basic IDE

This is a guide to help total beginners familiarize themselves with the Visual Basic development environment.

6_2008-2009 #213808
MultiInStr (Update Nov 7, 2009)

This is an improvement on the MultiInStr function that appears in other peoples code now and again ... I don't know who the original author was, so I hope who-ever you are you don't mind ... The original code would search through a string looking for occurences of single characters, while this pair of functions search for single-or-multi character terms within the given string ... Included are MultiInStr and MultiInStrR functions ... Hope someone finds them useful ... Update 25 May - improved versions added thanks to contributions from Kenneth Buckmaster ... Update 7 Nov - Reset string len bug fix in Ken's MultiInStr ... Happy coding

6_2008-2009 #213809
A Complete set of VB6 functions not available in VB5

Demonstrates how simple functions written in pure VB can be faster than many of VB's built in functions. For example, the super short and simple Split function is 30% faster than VB's. The Replace function with no API optimizations is 2 times faster than VB's, and over 3 times faster on large strings ... All functions are written in pure VB. Also declares the GetLocaleInfo API for use with the First Day Of The Week related functions, and for default system settings for the Formatting functions ... This would be a great learning tool for newbies. Of course, it would also be a great resourse for anyone using VB5, just plug this module into any project to enable all the VB6 functions it uses.

6_2008-2009 #213810
Fix Line Endings Program

This VB5 program can parse large text files reading in a chunk at a time and will replace UNIX Lf chars with Windows CrLf's, or vice-versa. It uses API to boost performance and is very fast. Demonstrates finding and replacing text that crosses over the chunk boundaries - and is further complicated by the need to access the previous char to avoid replacing a Lf with CrLf if already preceded by a Cr. Uses no VB6 only functions and is just 32k compiled with no compiler optimizations. Includes word list to parse - a tiny file really at 4.5 MB but parses in a blink even in the IDE. Hope someone finds it interesting, or even useful! Happy coding, Rd :)

6_2008-2009 #213811
Extremely Fast Case-Insensitive Unicode String Array Sorting Class

Extremely Fast Case-Insensitive Unicode String Array Sorting Class (Revision II) *********************************************** This string sorting class is extremely fast at case-insensitive sorting operations due to the combination of a highly optimized Blizzard quicksort algorithm, extremely fast in-place unicode comparison thanks to Ralph Eastwood, and a unique textual compare lookup table that is built only once at initialization in just over one hundredth of a second thanks to LukeH, and stored in a long array which is accessed in-line to minimize the case-conversion impact on this supremely fast comparison algorithm. Its performance on case-insensitive operations is only slightly slower than its case-sensitive binary compare operations, and is well over two times faster than StrComp's textual compare mode when used within the very same algorithm. Turning off strict compatibility with VB's StrComp function will improve performance on case-insensitive operations even further. *********************************************** Special thanks to the following for their generous contribution to this sorting class: ***************************** QuickSort Origins ~ C.A.R. Hoare ******************** String Comparison ~ Ralph Eastwood (tcm) ************* LowerCase Conversion ~ LukeH (selftaught) ************ SafeArray Substitution ~ Luke, Ralph, & Rd *********************************************** Blizzard quicksort algorithm and in-line lookup table by Rd :) *********************************************** Revision I - Fixed potential bug! Added demo project. *********************************************** Revision II - Fixed null-string descending bug!

6_2008-2009 #213812
Kill Folder function with persistence

This is a Kill Folder function with persistence ... It will remove all sub-folders and files and then optionally delete the specified folder ... I found when removing all the files in the temp folder that some locked files would fail and cause it to not continue with the rest of the files ... This function will continue to remove all unlocked files, even after finding locked files. However, if locked files are found, the parent folder will also not get removed.

6_2008-2009 #213813
API data types

Explains the use of non-VB data types to help in converting C declarations to Visual Basic. 10k zip

6_2008-2009 #213814
Tips

Some very basic but handy tips for newbies (and maybe not so newbies). Hope you learn something. I've added quite a bit more to the article, mostly very basic info on the vb language, but we all had to learn this stuff when we started out.

6_2008-2009 #213815
JpgStrip v1 Freeware Source Code

This JPEG strip code is in response to a recent submission on JPEG info extraction. This code was developed by David Crowell using vb5, so don't vote. I posted it for those interested in learning more about the internals of the JPEG graphic format. Please follow Davids request to leave this zip archive intact if you re-distribute it. This is version 1, and David is still developing it, he has a freeware exe version 1.3 available at: www.ksurf.net/~bermania/prog/dessin/jpgstrip.zip I don't know whether sourse code is available.

6_2008-2009 #213816
InstallFile module - Install files on end user's machine w/o copy older version over a new version.

When installing a file on an end user's machine, you should not copy an older version of the file over a new version. The InstallFile wrapper in the InstFile.bas module uses the VerFindFile and VerInstallFile API functions provided by Version.dll to copy files to the user's machine, and will not overwrite an existing file with an older version. The InstFile.bas module requires the GetVersionInfo wrapper in the VerInfo.bas module (also included) which uses several API functions also provided by Version.dll, most importantly the GetFileVersionInfo function.

7_2009-2012 #235516
An Inter-App Messaging Control v3 - Update 7 Nov 2009

This is a complete and functional control that uses the Copy Data Structure to pass data between applications that utilize this control. It allows you to pass numeric data, strings, dates, currency, in fact all data types (except variants), including arrays and udts, and arrays of udts (except arrays of variants and strings). Update v3 removed the parent hook, and fixed a bug in passing UDTs and now works in both VB5 and VB6. Updated demo thanks to Zhu now shows Unicode strings.

7_2009-2012 #235517
Setting and getting file attributes w/o affecting other attributes - Updated

These two simple wrappers can be used for setting and retrieving individual or selected file attributes without affecting the other attributes of the file. For example, to set the Archive bit of a file you should not just set its attributes to vbArchive (32), as this will turn off any other attributes currently set. Normally you would need to get the file attributes, add the desired attribute to the current attributes, then set them again. These wrappers just hide the details of this process. Update thanks to redbird77. +++++++++++++++++++++++++++++++++++++++++++++++++++ With the GetAttrib wrapper you can easily test the current state of an attribute. You simply specify the attribute(s) and the function will return True if the specified attribute(s) is set to on. You can specify more than one attribute and True will be returned only if all specified attributes are turned on. +++++++++++++++++++++++++++++++++++++++++++++++++++ The SetAttrib wrapper simplifies the setting of an attribute to on or off, and will be set as desired irrespective of its current state. You can set more than one attibute at a time (eg. SetAttrib(sFile, vbReadOnly Or vbHidden) will set these attributes to on, no matter if they are on or off, without affecting other attributes that may be set. +++++++++++++++++++++++++++++++++++++++++++++++++++ My first version of the SetAttrib function used 'Xor' to turn attributes off, but thanks to redbird77, I have updated it to 'Not' which has eliminated a limitation of my version. The bottom line is that you can set a files attribute(s) to on or off without needing to know the current state of the specified attributes, while not affecting other attributes that may be set.

Languages
Top Categories
Global Discovery