|
-
Mar 26th, 2002, 10:43 AM
#1
Thread Starter
Frenzied Member
Challenge
I challenge everybody to find documentation on the Dictionary object, all its properties and methods, in VBScript at MSDN.
For those of you who are smart, you can skip this waste of time and just find me some documenation from anywhere.
<rant>Not only is VB/VBScript crappy, substandard languages that I am absolutely sick of working with, but they were documented by 3-year olds.</rant>
Travis, Kung Foo Journeyman
As always, RTFM.
WWW Standards: HTML 4.01, CSS Level 2, ECMA 262 Bindings to DOM Level 1, JavaScript 1.3 Guide and Reference
Perl: Learn Perl, Llama, Camel, Cookbook, Perl Monks, Perl Mongers, O'Reilly's Perl.com, ActiveState, CPAN, TPJ, and use Perl;
YBMS, but Mozilla doesn't.
-
Mar 26th, 2002, 11:25 AM
#2
Fanatic Member
-
Mar 26th, 2002, 11:36 AM
#3
Thread Starter
Frenzied Member
Well, thanks for playing atleast. I haven't looked the sites you provided, yet. I found what library the dictionary object is in and I'm using the autocomplete in VS to list the properties, methods, and their aurgements, so I can do work with VBScript.
But am I correct in assuming that the dictionary object has no built-in sort. Niether does an array in VBScript, does it?
So again, can I ask someone why in the hell would you use VB/VBScript for a real world application?!
And ofcourse, THERE IS NO FREAKIN' REGEX!!!!!
(hell, have the VB community probably doesn't even know what regex is)
Travis, Kung Foo Journeyman
As always, RTFM.
WWW Standards: HTML 4.01, CSS Level 2, ECMA 262 Bindings to DOM Level 1, JavaScript 1.3 Guide and Reference
Perl: Learn Perl, Llama, Camel, Cookbook, Perl Monks, Perl Mongers, O'Reilly's Perl.com, ActiveState, CPAN, TPJ, and use Perl;
YBMS, but Mozilla doesn't.
-
Mar 26th, 2002, 11:42 AM
#4
Thread Starter
Frenzied Member
I wonder what is faster..
Code:
Dim myDict
Set myDict = Server.CreateObject("Scripting.Dictionary")
myDict.Add("Name") = "Bob"
myDict.Add("Mission") = "Burn"
Or...
Code:
Dim Name
Name = 0
Dim Mission
Mission = 1
Dim myArray(2)
myArray(Name) = "Bob"
myArray(Mission) = "Burn"
Then you have to imagine if you were going to great a big nested structures. A dictionary of dictionaries, or an array of arrays. I have to seriously wonder if the array of arrays would consume less memory and be faster.
Travis, Kung Foo Journeyman
As always, RTFM.
WWW Standards: HTML 4.01, CSS Level 2, ECMA 262 Bindings to DOM Level 1, JavaScript 1.3 Guide and Reference
Perl: Learn Perl, Llama, Camel, Cookbook, Perl Monks, Perl Mongers, O'Reilly's Perl.com, ActiveState, CPAN, TPJ, and use Perl;
YBMS, but Mozilla doesn't.
-
Mar 26th, 2002, 11:48 AM
#5
Black Cat
Originally posted by CiberTHuG
And ofcourse, THERE IS NO FREAKIN' REGEX!!!!!
???
VBScript, JScript, and javascript (I think with ECMA) all have Perl-style regular expressions built in.
Code:
Function ValidateSSN(SSN)
Dim re
Set re = New RegExp
re.Pattern = "^[\d]{3}-[\d]{2}-[\d]{4}$"
ValidateSSN = re.Test(SSN)
Set re = Nothing
End Function
Josh
Get these: Mozilla Opera OpenBSD
I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.
-
Mar 26th, 2002, 12:03 PM
#6
Thread Starter
Frenzied Member
JavaScript does, and it may be dictated by ECMA-262. If so it would imply that JScript does. I didn't know VBScript does.
This goes back to the crappy documentation issue. Does VB, or just VBScript?
I could use RegEx to find keys a little easier. I still have to loop through them, but now I don't have to compare everything.
In a slight tangent. I don't think I'm going to use the dictionary object like I thought I was. I can do all the same with an array of arrays and just use variables so I don't have to keep track of all of the array indices.
I do like the dictionary object, I just don't see the need to use it unless the keys are defined at runtime. In other words, if you say myDict.Add myKey, myValue instead of myDict.Add "myKey", myValue.
Now I have to write an array sort.
Travis, Kung Foo Journeyman
As always, RTFM.
WWW Standards: HTML 4.01, CSS Level 2, ECMA 262 Bindings to DOM Level 1, JavaScript 1.3 Guide and Reference
Perl: Learn Perl, Llama, Camel, Cookbook, Perl Monks, Perl Mongers, O'Reilly's Perl.com, ActiveState, CPAN, TPJ, and use Perl;
YBMS, but Mozilla doesn't.
-
Mar 26th, 2002, 12:10 PM
#7
-
Mar 26th, 2002, 01:42 PM
#8
Black Cat
Originally posted by CiberTHuG
This goes back to the crappy documentation issue. Does VB, or just VBScript?
Just VBScript, and VB.NET. I'm betting you can't use Perl, but you can use Windows Scripting Host to wrap Perl scripts in a COM object, which then can be called from VBScript... Makes my life easier...
Josh
Get these: Mozilla Opera OpenBSD
I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.
-
Mar 26th, 2002, 02:32 PM
#9
Thread Starter
Frenzied Member
Nah, can't do that either. All of the code I write has to be able to be supported by monkeys who only understand VB.
I want a new job so bad.
Travis, Kung Foo Journeyman
As always, RTFM.
WWW Standards: HTML 4.01, CSS Level 2, ECMA 262 Bindings to DOM Level 1, JavaScript 1.3 Guide and Reference
Perl: Learn Perl, Llama, Camel, Cookbook, Perl Monks, Perl Mongers, O'Reilly's Perl.com, ActiveState, CPAN, TPJ, and use Perl;
YBMS, but Mozilla doesn't.
-
Mar 27th, 2002, 11:02 AM
#10
Frenzied Member
It's funny reading people bash the MS documentation. That is one of the things that is really good about their dev tools. No other dev tool has even close to the level of documentation that MS's development tools do.
Just by typing in 'Dictionary' in MSDN I get:
Visual Basic Scripting Edition Language Reference
--------------------------------------------------------------------------------
Dictionary
Object that stores data key, item pairs.
Remarks
A Dictionary object is the equivalent of a PERL associative array. Items, which can be any form of data, are stored in the array. Each item is associated with a unique key. The key is used to retrieve an individual item and is usually a integer or a string, but can be anything except an array.
The following code illustrates how to create a Dictionary object:
Dim d ' Create a variable.
Set d = CreateObject("Scripting.Dictionary")
d.Add "a", "Athens" ' Add some keys and items.
d.Add "b", "Belgrade"
d.Add "c", "Cairo"
...
Properties
CompareMode Property | Count Property | Item Property | Key Property
Methods
Add Method (Dictionary) | Exists Method | Items Method | Keys Method | Remove Method | RemoveAll Method
See Also
FileSystemObject Object | TextStream Object
--------------------------------------------------------------------------------
©2000 Microsoft Corporation. All rights reserved.
oOOo--oOOo
__ /\/\onte96
oOOo--oOOo
Senior Programmer/Analyst
MCP
[email protected]
[email protected]
Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..
-
Mar 27th, 2002, 11:36 AM
#11
Thread Starter
Frenzied Member
Sorry, Perl documentation is by far the best I have ever seen for any language. The Perl community is just such a better community, and the Camel book rocks.
But typing "visual basic scripting dictionary" at MSDN I get lots of crap, including the Dictionary object for Office 2000 and .NET.
If I actually go to msdn.microsoft.com/scripting and drill into "VBScript Documentation", "VBScript Langugae Reference", "Objects and Collections" I get crap.
Oooo.. there is the RexEx object. Cool. But no dictionary!!!
Again, VB doco sucks. I'm glad somebody can find something there, but on the whole, divining rods are easier.
Travis, Kung Foo Journeyman
As always, RTFM.
WWW Standards: HTML 4.01, CSS Level 2, ECMA 262 Bindings to DOM Level 1, JavaScript 1.3 Guide and Reference
Perl: Learn Perl, Llama, Camel, Cookbook, Perl Monks, Perl Mongers, O'Reilly's Perl.com, ActiveState, CPAN, TPJ, and use Perl;
YBMS, but Mozilla doesn't.
-
Mar 27th, 2002, 11:44 AM
#12
Fanatic Member
I like the online PHP docs, but your right, the Perl docs are excellent
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|