• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

test please delete

Collapse
This is a sticky topic.
X
X
  •  
  • Filter
  • Time
  • Show
Clear All
new posts

    Chuck Norris sold his soul to the devil for his rugged good looks and unparalleled martial arts ability. Shortly after the transaction was finalized, Chuck roundhouse kicked the devil in the face and took his soul back. The devil, who appreciates irony, couldn't stay mad and admitted he should have seen it coming. They now play poker every second Wednesday of the month.

    Superman owns a pair of Chuck Norris pajamas.

    Chuck Norris was originally cast as the main character in 24, but was replaced by the producers when he managed to kill every terrorist and save the day in 12 minutes and 37 seconds.
    Where are we going? And what’s with this hand basket?

    Comment


      ******* VB

      Code:
      array(row,column) is object(index).value.tostring
      does not equate the same as

      Code:
      array(row,column) = object(index).value.tostring
      But sometimes it does

      4 hours I can't afford to loose i've lost




      Coffee's for closers

      Comment


        Originally posted by Spacecadet View Post
        ******* VB

        Code:
        array(row,column) is object(index).value.tostring
        does not equate the same as

        Code:
        array(row,column) = object(index).value.tostring
        But sometimes it does
        To start with, "Is" and "=" do completely different things.

        "Is" determines whether two object references refer to the same thing.

        "=" when used as a comparison operator (as opposed to being used as an assignment operator) has more complex type-dependent semantics.

        Oh, FFS - even as I write, MS seem to have changed the UI to the MSDN Library - and not for the better

        Hang on while I work out where they've put everything and re-check those links

        Aaaaagh! <- for Bill

        Hang on, let's see if it works in IE/Windows - more to follow...

        Ah, it works (sort of) in Firefox - they've just broken their site on Safari. What a bunch of losers. No wonder Google are eating their lunch.

        OK, back again

        In the case you describe, you are invoking the "toString" method. I was going to look at that and determine the precise reason why your problem arose, but Microsoft fscked up their library as I was checking it out, and without any means of navigating the library, the search function just gives me some irrelevant post from the VB team's blog.

        Anyway, you will note that the link relating to the "=" comparison operator above includes the text:
        Note The Is and Like operators have specific comparison functionality that differs from the operators in the table.

        Basically, when you invoke the "toString" method, you are asking that the thing on which you invoke it should be converted into a string, and returned as a reference to a new String object. However (and I'm guessing at this, but you should be able to test it and see if I'm right) if that object is already an object of type String, it will simply return a reference to itself.

        So, to return to your example: when
        Code:
        array(row,column)
        and

        Code:
        object(index).value
        refer to the same instance, and the type of that instance is already String, invoking the toString method:

        Code:
        object(index).value.tostring
        will return the same object reference, and so "Is" will succeed, as will "=".

        However, if the type of that instance is something other than String (e.g. 42) then the invocation of the toString method will create a reference to a new object instance, being the string representation of the original, and of type String - but this will not pass the "Is" test (as it is not the same object as the number object that was the original property also referenced by the array) but will pass the "= (comparison)" test as some type conversion will occur behind the scenes.

        As I said earlier, "Is" and "=" do two completely different things - they aren't synonymous, and "=" has more complex implications in relation to type conversion than "Is".

        HTH
        Last edited by NickFitz; 9 October 2008, 02:04.

        Comment


          Originally posted by Diver View Post
          1. When Chuck Norris does a pushup, he isn’t lifting himself up, he’s pushing the Earth down.
          When I walk, I stay in the same place and roll the Earth around beneath my feet

          Originally posted by Diver View Post
          1. Chuck Norris can lead a horse to water AND make it drink.
          I can lead a whore to culture AND make her think

          Comment


            Oh my goodness.... I am the first today!

            Morning everyone
            Bazza gets caught
            Socrates - "The only true wisdom is in knowing you know nothing."

            CUK University Challenge Champions 2010

            Comment


              Originally posted by cailin maith View Post
              Oh my goodness.... I am the first today!

              Morning everyone
              Morning

              I was having a quick read over in General, don't know why I bothered.

              Comment


                another busy day today... and probably a lot of this followed by and

                Comment


                  Good effort with the Chuck things last night boyos

                  Diver, I love the frost bite one
                  Bazza gets caught
                  Socrates - "The only true wisdom is in knowing you know nothing."

                  CUK University Challenge Champions 2010

                  Comment


                    Originally posted by FiveTimes View Post
                    Morning

                    I was having a quick read over in General, don't know why I bothered.
                    Yeah - sometimes not worth the effort of reading is it??
                    Bazza gets caught
                    Socrates - "The only true wisdom is in knowing you know nothing."

                    CUK University Challenge Champions 2010

                    Comment


                      Chuck Norris once ate an entire ream of rice paper and shat out origami swans and Mister Miyagi from Karate Kid.

                      Comment

                      Working...
                      X