Advertisement

Results for "Author: rde"

3_2004-2005 #134648
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.

3_2004-2005 #145446
Demonstrating Objects and Arrays

This demonstrates the use of Objects and Arrays using simple examples. Shows the differences between objects and arrays, adding properties and methods, explains associative arrays, constructor functions, all by example. Although I have put it in the beginners section, experienced js scripters may find some interesting facts about arrays lengths, deleting items and more. Hope you find it helpful.

4_2005-2006 #167962
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.

4_2005-2006 #167963
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.

4_2005-2006 #167964
The Question of Existence

I have come across several different solutions for testing for a file's existance, from Dir to opening the file, testing for error, then closing the file again. I remembered an article/comment by Bruce McKinney that influenced my solution to this problem and thought I would share it.

4_2005-2006 #168752
Demonstrating Objects and Arrays

This demonstrates the use of Objects and Arrays using simple examples. Shows the differences between objects and arrays, adding properties and methods, explains associative arrays, constructor functions, all by example. Although I have put it in the beginners section, experienced js scripters may find some interesting facts about arrays lengths, deleting items and more. Hope you find it helpful.

4_2005-2006 #168753
FileSync Utility v5 Unicode Enabled

Simple synchronize backups and remove duplicates utility Added option to remove empty folders after delete operations v3 adds the option to use file CRCs for exact matching - this helps in situations where time stamps are different when files are still identical. v4 updates the whole project to use the 'W' API functions to preserve unicode. v5 fixes a bug introduced in v4

4_2005-2006 #168754
Unpack specified file from RAR Archive

This module is a wrapper for the unrar.dll freely available from www.rarlab.com Enables unpacking a specified file from a RAR archive, both to disk as a file or only to memory (string variable) as the file text. There are a couple of other posts on RAR archives, and extracting a single file from an archive has not been demonstrated, and I needed this functionality for my ZipSearch project. Thought others might be interested in this functionality - reuse as you see fit. Note that the declares for the library functions are named unrar and unrar3 depending on the version you have. Get a free copy of this DLL from: www.rarlab.com - Extras www.rarlab.com/rar_add.htm - UnRAR.dll ftp://ftp.rarlab.com/rar/UnRARDLL.exe Happy coding :)

4_2005-2006 #168755
As$ociative Arrays in VB

As$ociative Arrays in VB. Thanks to: G.M.Adelson - Velskii And E.M.Landis - Herbert Glarner - Julienne Walker - Kelly Ethridge. 54k zip

4_2005-2006 #168756
A Customizable CD/DVD/Etc Collection Database Program v1.5

This is a customizable CD/DVD/etc collection database program. Use it to document your collection of CD'd, DVD's, or other collection you might have. Uses a simple flat file to store the data. Included is an Excel spreadsheet that can open the flat file db. Update 1.5 no longer requires the default database and allows easier creation of new db's. Update 3rd June - Fixed spreadsheet.

4_2005-2006 #168757
Callers Add-in [FINAL 2.24 - Sept 12, 2011]

UPDATE 2.21: fixed fatal typo bug introduced in v2.2 ... UPDATE 2.22: fixed 'exclude addin designer' introduced in v1.9 ... UPDATE 2.23: fixed 'underscore' incorrect behavior introduced in v1.8 (Initialize matched Class_Initialize) - thanks heaps to Kenneth Ives (kenaso) for your feedback ... UPDATE 2.24: fixed yet another bug - discovered the VBE Find function searches up to but not including the specified last line. Now correctly handles API declares with line continuation ... DETAILS: I borrowed code from Kamilche, Ulli and Darryl Hasieber to create this quite simple VB add-in that adds something I've sometimes needed as projects get too large and complex ... It adds a couple of entries to VB's code pane context menu so that when you right-click within a procedure (or on a declare) and select 'Callers' you get a popup menu listing all other routines in the project that call this code member ... It displays which routines reference any particular code member in the project, and allows you to select one to go to it - and a second entry called 'Callee' to go back if you wish ... FEATURES: Callee's include all procedures, API declares, Enums and Types, module level constants and variables, Implemented classes and Raised Events. Also identifies parent Type or Enum when right- clicking on one of their members. Finds public Enums of classes without being qualified by class name. Also adds a 'Clear' menu item to the Immediate Window ... This will probably be the last update as it seems to work fairly well now. However, bug reports or suggestions for improvement may see some further updates ... Just compile the project to automatically add the add-in to VB and get two new menu items 'Callers' and 'Callee' on the code context menu ... If you have compiled a previous version compile again with no VB IDE's open by selecting 'Make' on the Caller.vbp's context menu ... 16 kb zip.

4_2005-2006 #168758
A generic stable indexed data sorting class

With this generic solution you can sort any data that is stored in an indexed data storage structure such as lists, collections, and arrays of all data types, including multi-dimensional arrays and arrays of UDTs ... Three methods are demonstrated - Event raising WithEvents, an Implemented callback, and a clever CallWindowProc technique I picked up from LukeH (selftaught) ... The Implemented callback method is almost twice as fast as the Event raising method, and is also slightly faster than the CallWindowProc method ... This is a complete solution that allows you to cancel sorting within the Compare routine, and also a progress parameter that indicates the percentage completed as a long value of 1 to 100. These features are included in the demo ... Update 21 Feb 2008 tweaked a little speed and attempted to create a level performance test between the CWP method and the other two - now just a few 100ths of a second behind the Implemented method ... Obscure Bug Fix 7 March 09. I documented they 'can sort sub-sets of the array data' but with these indexed versions if you do an error *could* occur without this very small change.

4_2005-2006 #168759
A Comprehensive Spell Checker Revisited 4 (Update 12 Aug 2012)

This is an improved version of the spell checker from Shelz's COTM "A Comprehensive Spell Checker" at txtCodeId=65992. It includes a modified Russell Soundex phonetic algorithm and the Levenshtein Distance algorithm. It is now a *very* fast and effective spell checker solution... It impressed me with its most effective and concise spell checking algorithms, a perfect demo project, and the smart way it provided a complete database of words in a 1.3 MB download... But like many other spell checkers it had a common limitation... The basic aim of the Soundex algorithm is for names with the same pronunciation to be encoded the same so that matching can occur despite minor differences in spelling. The Soundex for a word consists of a letter followed by three numbers: the letter is the first letter of the name, and the numbers encode the remaining consonants. Therefore, only words beginning with the same first letter are compared for similar pronunciation using the standard algorithm... This version of the Russell Soundex algorithm has been modified to allow the matching of words that start with differing first letters so as not to assume that the first letter is always known. In this version the encoding always begins with the first letter of the word... The Levenshtein Distance algo marries perfectly with the results to identify the correct spelling for the given (mis-spelt) word every time! A search on the word "apolstry" with the minimum successful Levenshtein Distance returns just four words where one of these is "upholstery"... [Version 2] - Removed the dependence on the DAO library and is contained in a single text file. The Soundex encoding has been extended to include a 'reverse soundex' of all words (encoding from the end of the words backwards as well). On my 866MHz PC the access database took minutes to create the words database and was quite slow processing the lookup query, particularly after adding the reverse soundex to the query. Creating the database now takes 25 seconds and the lookups are now fast enough to be in real time (updated with every text entry change event)... [Update 18 Feb 09] - Improved speed of data loading at form load from 1.2 to 0.9 seconds on 866MHz PC. On my Athlon 4000+ the database builds in under 10 seconds and the data loads at form load in well under 0.5 seconds. On your average PC this would be fast enough to unload the form every use and re-load it when needed without the user experiencing any delay... [Update 21 Feb 09] - Added code to normalise words file to expected format (removes empty lines and converts comma delimited files)... [Version 3] - Considerably improved speed of both Soundex and Levenshtein Distance algos by eliminating Mid$(s,i,1) creating a temp string for every character and comparing chars, to using copymemory to grab the unicode value and comparing int's instead. I think the MidI code used was authored by Bruce McKinney, but if it is yours let me know and I will give you credit... [Version 4] - Injected some asm machine code into the database creation sub and now builds the database in a blink! Big thanks to Robert Rayment for your generous help with as$embler Happy coding, Rd :)

4_2005-2006 #168760
Pretty File Names v2.2 - Final 2-16-08

Hi again all. This module will sort string array items of file paths which may contain numeric characters in a more natural order. I created this in response to a comment made on a previous submission. It is complete with demo and sample files so you can easily load and sort to see the results of the different settings available. ++++++++++++++++++++++++++++++++++++++++++++++++ It is intended for sorting file names, and will apply the same intuitive order for folders in the file path if they contain numeric characters. It will take into account all occurences of numbers in the string item including in the extension. ++++++++++++++++++++++++++++++++++++++++++++++++ Specifying a path is not required, neither do they need to have extensions, in fact, they do not need to be file names at all; just strings that may contain numeric characters within the string text. In other words, it can be used for normal pretty-sorting operations as well. But please note, this is intended for sorting file names and is a little slower than the included Pretty Number Sorter because of extra code to handle the extensions. ++++++++++++++++++++++++++++++++++++++++++++++++ It can order the items by extension, whilst still producing an intuitive order of the file path and names that may have numbers within them and that have the same extension. Or you can group by folder but still include extensions in the comparisons without grouping by them. ++++++++++++++++++++++++++++++++++++++++++++++++ Also included is a compare function that can be used in place of VB's StrComp that will order the filename items it compares based on the settings described above. It does not sort an array of items but compares just two items and returns the result. ++++++++++++++++++++++++++++++++++++++++++++++++ This is version 2 (2-5-08) in response to a request to add the handling of numbers in the extension. Bug Fix update 2-6-08. ++++++++++++++++++++++++++++++++++++++++++++++++ Version 2.1 (2-7-08) adds Indexed versions of my Pretty Sorters. Included in this module: strPrettyFileNames, strPrettyFileNamesIndexed, StrCompFileNames, strPrettyNumSort, strPrettyNumSortIndexed, StrCompNumbers, strPrettySort, strPrettySortIndexed, ValidateIdxArray, strStableSort2Indexed, strSwapSort4Indexed, InitedArray ++++++++++++++++++++++++++++++++++++++++++++++++ Update (2-8-08) removed the 260 character limit on the three file name routines. ++++++++++++++++++++++++++++++++++++++++++++++++ Update (2-15-08) with latest and final version of Stable QuickSort v2.2. ++++++++++++++++++++++++++++++++++++++++++++++++ Update (2-16-08) I just had to fix a design weakness. Removed the requirement to initialize the index array before passing to the indexed sorters. Final number 2! ++++++++++++++++++++++++++++++++++++++++++++++++

4_2005-2006 #168761
Stable QuickSort v2.3 - SAFEARRAY Final (7th March 2009)

Grab hold of your snow boards folks - Rd's stable non-recursive quicksort algorithm the Avalanche just got even faster ... This is the latest and final version of my non-recursive quicksort based algorithm that has been written from the ground up as a stable alternative to the blindingly fast quicksort ... It is not quite as fast as the outright fastest non-stable quicksort, but is still very fast as it uses buffers and copymemory and is beaten by none of my other string sorting algorithms except my fastest non-stable quicksort ... A standard quicksort only moves items that need swapping, while this stable algorithm manipulates all items on every iteration to keep them all in relative positions to one another. This algorithm I have dubbed the Avalanche ... See included html page in 21k zip for details ... Also included is an Avalanche based pre-sorter and the latest version of my insert/binary hybrid Twister algorithm which utilizes the pre-sorter ... Obscure Bug Fix 7 March 09. I documented it 'can sort sub-sets of the array data' but with the indexed version if you do an error *could* occur without this very small change ... This is definitely the final version of this unique algorithm, I have very much enjoyed developing it. I hope you like it. Happy coding from Rd :)

4_2005-2006 #168762
FileTime - Files date and time module (Bug fix 24 May 09)

FileTime API declares and handy wrapper functions. Bug fix 24 May 09 in FileTimeToDosTime and SysTimeToDosTime funcs.

4_2005-2006 #168763
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.

4_2005-2006 #168764
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.

4_2005-2006 #168765
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 ...

4_2005-2006 #168766
Array Basics (FIXED 18-Apr-08)

Array basics for beginners

Languages
Top Categories
Global Discovery