Results 1 to 12 of 12

Thread: Challenge

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2001
    Posts
    1,140

    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.

  2. #2
    Fanatic Member punkpie_uk's Avatar
    Join Date
    Sep 2001
    Location
    UK
    Posts
    645

    Post

    A bit annoyed at Microsoft?

    I found this at MSDN http://msdn.microsoft.com/library/en...c03_dictionary. Its not much but its the best thing on there.

    I usuaully use w3schools.com for stuff like this. http://www.w3schools.com/asp/asp_ref_dictionary.asp

    If found these exampleshttp://www.asptraining.com/learn/dictionary.asp

    http://www.4guysfromrolla.com/webtech/102898-1.shtml

    http://www.asptutorial.info/Dictionary.htm

    Do I Win?
    SPREAD THE WORD!!! Are You Lee McCormick? Because I Am



    Lee M McCormick
    [email protected]

    Lee McCormick.com - Live
    Dynamically Webbed.com - In development but live

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2001
    Posts
    1,140
    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.

  4. #4

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2001
    Posts
    1,140
    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.

  5. #5
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032
    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.

  6. #6

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2001
    Posts
    1,140
    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.

  7. #7
    Fanatic Member punkpie_uk's Avatar
    Join Date
    Sep 2001
    Location
    UK
    Posts
    645
    I didn't know about patterns in VBScript either.

    Use arrays, arrays are much better. What happened to the good old days of BASIC programming?

    I definatly agree that VBScript should have a sort function. Theres a couple of wasy to get around it though. You could create a empty recordset, feed the data into it and sort it. Or you could use one of the free sort algorithyms. Try QSort...

    http://watson-net.com/free/asp/s_qsort.asp
    SPREAD THE WORD!!! Are You Lee McCormick? Because I Am



    Lee M McCormick
    [email protected]

    Lee McCormick.com - Live
    Dynamically Webbed.com - In development but live

  8. #8
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032
    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.

  9. #9

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2001
    Posts
    1,140
    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.

  10. #10
    Frenzied Member monte96's Avatar
    Join Date
    Sep 2000
    Location
    Somewhere in AZ
    Posts
    1,379
    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..

  11. #11

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2001
    Posts
    1,140
    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.

  12. #12
    Fanatic Member punkpie_uk's Avatar
    Join Date
    Sep 2001
    Location
    UK
    Posts
    645
    I like the online PHP docs, but your right, the Perl docs are excellent
    SPREAD THE WORD!!! Are You Lee McCormick? Because I Am



    Lee M McCormick
    [email protected]

    Lee McCormick.com - Live
    Dynamically Webbed.com - In development but live

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width