Conversion Problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • John

    #31
    Re: Conversion Problem

    Are you sure i + j * 2 + k * 2 * 3 gives the required index for the new
    array only this doesn't seem to work

    I can now get the records ok and get back all the other information but when
    i use the i,j,k to get the value from xcoords(100, 10, 2) or
    ycoords(100,10, 2) I seem to get zero returned when it is not zero.

    for example if i need to access xcoords(1,1,1) this translates to accessing
    xcoords(9) in the new array is that correct? Or should there be some
    brackets in the above evaluation.

    "Patrice" <http://www.chez.com/scribe/wrote in message
    news:BAF19267-E4A6-4845-84BC-63B8AB985100@mi crosoft.com...
    So for the array issue I tried the following :
    >
    VB6 side Ive got a x(1,2,3) integer array...
    >
    VB.NET side I've got the following structure :
    >
    <VBFixedArray(2 3)Public _x() As Short
    >
    Public Property x(ByVal i As Integer, ByVal j As Integer, ByVal k As
    Integer) As Short
    Get
    Return _x(i + j * 2 + k * 2 * 3)
    End Get
    Set(ByVal value As Short)
    ' TODO
    End Set
    End Property
    >
    That is :
    >
    - the _x array is a single dimension array whose size is the same as the
    3D array VB6 side. It allows to read the array using FileGet
    >
    - I expose this array as a 3D array using a property so that x looks like
    a 3D array... (each cell is at a position so that each index uses the
    number of elements for all the previous indices as an offset)
    >
    It should be similar enough to VB6 to be usable while watijgn perhaps to
    switch to something better if another idea or a later update gives better
    support...
    >
    --
    Patrice
    >
    "John" <no-email-supplied@nothin g.coma écrit dans le message de groupe
    de discussion : #6CgA4z4IHA.439 2@TK2MSFTNGP03. phx.gbl...
    >Hi Patrice
    >>
    >My overall intent is to convert an existing VB6 application into vb.net
    >so I can still use multiple records I created in the new application. I
    >have managed to handle all the other type conversions so vb net handles
    >then using the fileopen, fileget, fileput but the following record as
    >stopped the conversion in its tracks because of the multidementiona l
    >array aspect.
    >>
    >The vb6 type structure is as follows:
    >>
    >Type satlocation
    >>
    > origin As Integer
    >>
    > locationfixed As Boolean
    >>
    > timefixed As Boolean
    >>
    > numberofsets As Integer
    >>
    > xcoords(100, 10, 2) As Single
    >>
    > ycoords(100, 10, 2) As Single
    >>
    > stamp As Date
    >>
    >End Type
    >>
    >What I need to do is to be able to read and write to randomly to existing
    >data in the above record set that was created under vb6 - as you can see
    >there are literally thousands of cords that I certainly do not want to
    >input again, so basically I need to use the this same record set.
    >>
    >>
    >>
    >"Patrice" <http://www.chez.com/scribe/wrote in message
    >news:9F09107 A-9FEE-42DC-B775-A2EDB7FDB744@mi crosoft.com...
    >>What is the overall intent ? It's true that VB.NET is different. For
    >>example the way to persists data is totally different so if you need to
    >>read legacy data, it might be usefull to consider the other options that
    >>.NET could bring to the table ("serialization " i..e the ability to
    >>persist data structure to disk or using datasets that are a in memory db
    >>representatio n (suitable only for small amouts of data) or a real db.
    >>>
    >>Let me know if you are still heading to VB.NET I'll try to give this a
    >>closer look with a working sample...
    >>>
    >>>
    >>--
    >>Patrice
    >>>
    >>>
    >>"John" <no-email-supplied@nothin g.coma écrit dans le message de groupe
    >>de discussion : uF9Fmes4IHA.996 @TK2MSFTNGP04.p hx.gbl...
    >>>OK forget it - there is a more serious problem with this, it seems that
    >>>vb8 does not support arrays declared like arr1(10,10,10) because when
    >>>you try to do the Fileput it just gives an error saying only 2
    >>>dimentiona l arrays are supported - what a load of tat!!!
    >>>>
    >>>i think i'll go back to vb6 that was a true RAD piece of kit, my only
    >>>other option it seems is to scrap all my hundreds of records and then
    >>>design the structure in vb8 so that it is something like
    >>>>
    >>>dim arr1(100,2)
    >>>dim arr2(100,2)
    >>>:
    >>>:
    >>>dim arr100(100,2)
    >>>>
    >>>>
    >>>just to get the same thing as dim arr1(100,100,2)
    >>>>
    >>>"John" <no-email-supplied@nothin g.comwrote in message
    >>>news:%23EbLz Ps4IHA.1892@TK2 MSFTNGP06.phx.g bl...
    >>>>Ok i've got the Runtime.Interop Services.... bit to work
    >>>>>
    >>>>I've done it on all the elements of the structure and added them
    >>>>together but i'm 4 bytes out?
    >>>>>
    >>>>I suppose i could just hard code the record length - but it seems a
    >>>>very poor way of doing things.
    >>>>>
    >>>>>
    >>>>"John" <no-email-supplied@nothin g.comwrote in message
    >>>>news:e%23pX H0r4IHA.3804@TK 2MSFTNGP03.phx. gbl...
    >>>>>thanks Patrice for that - i considered doing a fudge but the values
    >>>>>are out so there seems to be an overhead in the array structure
    >>>>>difference s in the vb6 and vb8 - the 2 values do not come out the
    >>>>>same anyway- they are a few hundred bytes different so the chances of
    >>>>>reading and writing correctly into the old records is zero, and i
    >>>>>don't fancy spending the rest of my life just trying to fudge
    >>>>>somethin g that works.
    >>>>>>
    >>>>>i tried
    >>>>>Runtime.In teropServices.M arshal.SizeOf(G etType(Short))* x.Length but
    >>>>>it just gives me an error saying length is not a member of x so i
    >>>>>don't know whether this would work or not!!
    >>>>>>
    >>>>>god i really hate this vb.net stuff - why is everything such a
    >>>>>pain? - nothing seems logical (for example, why have a vbfixedarray
    >>>>>statemen t that is limited to 2 dimentions?) and why they call it vb
    >>>>>god knows, i've used vb since the 70's without any problem everything
    >>>>>i try to do in this turns out to be a nightmare - perhaps i'm just
    >>>>>too old and fixed in my ways
    >>>>>>
    >>>>>>
    >>>>>"Patrice " <http://www.chez.com/scribe/wrote in message
    >>>>>news:5117F 78C-EEF3-4D66-888B-BCED135B7145@mi crosoft.com...
    >>>>>>An array is basically a pointer so the Len is not correct.
    >>>>>>>
    >>>>>>A trick could be to use <VBFixedArray(1 0 * 10 * 4)x() As Short to
    >>>>>>read your data and possibly to copy in the final array (it might be
    >>>>>>needed anyway as I'm not sure if .NET arrays and VB arrays are
    >>>>>>storing data using the same ordering).
    >>>>>>>
    >>>>>>Another option would be to compute the record length
    >>>>>>(Runtime. InteropServices .Marhsl.SizeOf( GetType(Short)) *x.Length)
    >>>>>>>
    >>>>>>Another option could be to read each member, you can add a method to
    >>>>>>your structure to do add (youll need just the overall size, is this
    >>>>>>a constant in your case ?) and AFAIK datta are read based on the
    >>>>>>length of the receiving object (depends also how is was done in VB I
    >>>>>>suppose ).
    >>>>>>>
    >>>>>>Your best bet would be likely to create a small test case using VB
    >>>>>>and reading use VB.NET wiht easy checkable values to test and
    >>>>>>diagnos e possible read/write problems more easily...
    >>>>>>>
    >>>>>>--
    >>>>>>Patrice
    >>>>>>>
    >>>>>>"John" <no-email-supplied@nothin g.coma écrit dans le message de
    >>>>>>groupe de discussion : uh$p3Bo4IHA.444 8@TK2MSFTNGP05. phx.gbl...
    >>>>>>>Hi
    >>>>>>>>
    >>>>>>>This .net is driving me crazy!!
    >>>>>>>>
    >>>>>>>In VB6 I had a type which contained a couple of multi-dimentional
    >>>>>>>arrays which i used to create and read records:
    >>>>>>>>
    >>>>>>>Type AAA
    >>>>>>>:
    >>>>>>>Array1(1 0,10,2) as Integer
    >>>>>>>Array2(2 0,20,4) as Integer
    >>>>>>>:
    >>>>>>>End Type
    >>>>>>>>
    >>>>>>>I'm trying to get vb8 set up so that i can use the same files and
    >>>>>>>use the fileopen method to randomly access the file data etc
    >>>>>>>>
    >>>>>>>vb8 won't let me use <vbfixedarraywi th more than 2 dementions so
    >>>>>>>i cannot declare it correctly in the structure declaration.
    >>>>>>>>
    >>>>>>>What i have done is:
    >>>>>>>>
    >>>>>>>Structur e z
    >>>>>>>:
    >>>>>>>dim Array1(,,) as short
    >>>>>>>dim Array2(,,) as short
    >>>>>>>:
    >>>>>>>End Structure
    >>>>>>>>
    >>>>>>>>
    >>>>>>>Dim x as z
    >>>>>>>I have then tried to Redim in an initialation so:
    >>>>>>>>
    >>>>>>>>
    >>>>>>>redim x.array1(10,10, 2)
    >>>>>>>redim x.array2(20,20, 4)
    >>>>>>>>
    >>>>>>>But when i go to get the record length Len(x) it is totally wrong
    >>>>>>>>
    >>>>>>>Is there any way out of this mess so i can use my original record
    >>>>>>>structur es with openfile and random access? Why does vbfixedarray
    >>>>>>>only allow 2 dementions?????
    >>>>>>>>
    >>>>>>>Cheers
    >>>>>>>John
    >>>>>>>
    >>>>>>>
    >>>>>>
    >>>>>
    >>>>
    >>>
    >>
    >

    Comment

    • Tom Shelton

      #32
      Re: Conversion Problem

      On 2008-07-11, Ken Halter <Ken_Halter@Use _Sparingly_Hotm ail.comwrote:
      "Tom Shelton" <tom_shelton@co mcastXXXXXXX.ne twrote in message
      news:j-GdnXjfwMOVFOrVn Z2dnUVZ_v_inZ2d @comcast.com...
      >On 2008-07-11, Ken Halter <Ken_Halter@Use _Sparingly_Hotm ail.comwrote:
      >>>
      >>...and he's not familiar with the framework because the help system sucks
      >>like a hoover.
      >>>
      >>
      >Please! And VB6's doesn't? MS help has sucked for years - fortunately,
      >there's this thing called the Internet....
      >
      Yeah... in dotNet, the internet is required. Not so for VB6 and its version
      of MSDN.... but, it makes sense the internet's required since MS
      specifically added .NET to the name. It's a web app generator. Now, if I
      were creating web apps, or even apps for a mobile device, I surely wouldn't
      use VB5/6... but for desktop apps I surely wouldn't want to use dotNet.
      >
      Oh, please. VB6 sixes help sucks rocks. VB5 had the last decent help. The
      internet has been the primary source of real help for years.
      >Duh, I said that was one of the reasons for control arrays? In VB.NET,
      >they
      >don't have to be a control array and they don't have to be the same type.
      >Or
      >are you claiming that you can have the same event procedure handle the
      >TextChanged event of a combobox and a textbox in VB6?
      >
      ummm... yes I am... I'm not sure why this is such a surprise. Have you never
      coded a sub to be called from multiple places? What difference does it make
      where the change event's coming from, or even what control fired it? If
      that's so important, pass the control to the sub. No big deal. geez.
      >
      So, you admit that the SAME event procedure can NOT handle the same event for
      diffent individual controls (not control arrays) or differing types of
      controls... Thanks.

      As for your work around, sure - used to do it all the time, still do as a
      matter of fact. It just depends on the task at hand. C#/VB.NET just adds an
      extra tool to my belt.
      >>Too bad that's not VB syntax. It's B#... I've been using basic and
      >>assembler
      >>since 1981 and basic has *never* used curly braces.
      >>
      >VB never had array or variable initialization on the same line before
      >either... A feature was added, and a syntax was chosen. Get over it.
      >
      Yeah, because it makes the code unreadable. My enter key works perfectly and
      I use it all the time.
      You think:

      Dim i As Integer = 10

      Is unreadable? Wow.
      >
      Dim i As Integer : I = 10 'is perfectly valid code in VB3,4,5,6 but no one
      uses that syntax because it's unreadable and (or should I say AndAlso) leads
      to bugs.
      Because that syntax sucks. The new syntax, is cleaner, highly readable and
      IMHO, more clearly convey's the intent of the author - thereby leading to
      less bugs.
      >
      While I'm at it, this "+=" and similar crap they've added to make C
      programmers more comfortable. What a mess that is. I can't believe people
      would rather save 2 freaking keystrokes than have easy to read code... but,
      I guess when you're in dotNet, every keystroke you can save counts, right?
      >
      Again, you don't like it - don't use it, but don't try to force your strange
      sesne of readability on others.
      >>*NOT* part of any basic language that makes sense.
      >>
      >You don't like LINQ - don't use it.
      >
      Thanks for the option... Don't like dotBloat either... so I don't use it.
      HTH
      >
      Again, a valid option. Hope it works for you, when the rest of the world
      moves on to distributed systems and 64-bit apps....
      >>That's SQL syntax and
      >>should stay as such. No use adding hundreds of keywords to an already
      >>over-bloated environment
      >>
      >Your oppinion.
      >
      Mine and about 5 million others, yep.
      Goody for them.
      >>>
      >>Very readable.... NOT
      >>
      >What? As opposed to:
      >>
      >Dim theButton As Button
      >theButton = buttons(btnInde x)
      >>
      >Sorry, but I think I like the one line rather then two bit.
      >
      If that was supposed to be VB syntax, you forgot the Set keyword.. the code
      you posted would attempt to pass the default property of those controls back
      and forth.
      >
      Set theButton = buttons(btnInde x)
      >
      Oh yea, Set. Another one of those idiotic VB.CLASSIC'isms , introduced as a
      bandaid to the whole default propety mess. You know, the feature that most
      proffesionals and MVP's discouraged people from using for years.

      Thanks goodness, I don't have to deal with that mess anymore...
      >>Which version(s) of the framework do your users need to
      >>download?
      >>
      >Which ever version my app needs. That's sort of a stupid question - how
      >many
      >Visual Basic runtimes are there? Oh, yeah one for every version.... And,
      >well were at it lets have a discussion about binary compatability, and dll
      >hell.
      >
      Check these groups. How many people say they've set their app for 2.0 but
      the installation forces them to install 3.5?
      >
      Because they screwed up their installer. What does that have to do with .NET?
      If you're having problems with Binary Compatibility and DLL Hell after all
      these years, I'm very sorry. Most of us have figured out how to deal with
      those problems.
      >
      Just as most of us have figured out how to deal with framework
      installations.. . But, it didn't stop you from bringing that up, so I thought
      I'd just point out one of the flaws in VB6 installations. Nothing is perfect.
      >>Microsoft surely doesn't make things easier on the developer. That
      >>went away when VS6 did... and, if the whole mess is so freaking
      >>"wonderful" ,
      >>why do they have to give it away free? You can still buy legit copies of
      >>VS6, but be prepared to pay more than VS2008 costs... but, if you want
      >>what
      >>you pay for, grab VS6
      >>>
      >>
      >They give it away for very good reasons. VS's current competition is
      >almost
      >all FREE. It's a market difference, and not a reflection on the quality
      >of
      >the product.
      >
      In your opinion.
      >
      Yes, just as your statements were your opinion... It's just that mine are
      more grounded in reality and the current market - but, I guess that's what
      comes of not shackling myself to a product that's useful lifetime expired some
      time in the last decade.
      >>>
      >>Yeah... or maybe just write the thing in VB6 and go on to the next job,
      >>eh?
      >>>
      >>
      >LOL... Yeah right. VB6 was a great tool in it's day, but compared to
      >.NET
      >it's a toy. To do anything of more then average complexity requires
      >jumping
      >
      A toy... yep. One that helped MS "rule the world" in the 90's. btw, try
      pasting a block of text in anything resembling an immediate window... what
      do you see? What ever it is, it's not what you pasted... now try selecting
      that block and pasting into the code window... didn't work at all, you say?
      Didn't think so.
      >
      What are you talking about?
      Now, try looking at only one procedure in your app.... collapse everything
      yet? Can you name a single app in the world that requires its users to edit
      text in a treeview? Without an option to turn it off? How about an option to
      view a single procedure at a time, without jumping through those dreadful
      hoops. Ain't gonna happen? That's because the design team doesn't care. It's
      their way or the highway.
      >
      Again, it does allow you turn off outlining. And yes, I have collapsed to
      definitions.... Ctrl+M,O.

      And no it doesn't have single procedure view. I'm sorry that you don't like
      that - but, you know what - I hate single procedure view. But, I'm sure if
      enough people requested it, it would have been added by now... Wait, maybe
      I'm not alone in hating single procedure view.
      >through some major hoops, which often if not done properly lead to crashes
      >and
      >hard to find instabilities. I can't tell you how often I read posts over
      >in
      >
      Hard to find instabilities.. . and you're questioning someone elses coding
      abilities? mmmkay. What ever... btw... in the computer world, if *anything*
      isn't "done properly", you'll get the same results.
      >
      When did I question your's or anyone elses abilities? You seem to take all fo
      this very personal and are reading things into my comments that I certainly
      did not say.... I like how you focus on the tail end of hte comment, instead
      on the important point - you know, the part about making anything of more then
      average complexity a major undertaking?
      >the classic group that have long complicated answers delving deep in to
      >the
      >API, that are solved in .NET apps in a couple of lines of code. But, if
      >you
      >like dealing in complexity (aka bug riddled apps) then by all means, keep
      >clinging to your out of date toy environment...
      >
      Thanks for that. I appreciate that you've allowed me to continue to work in
      VB6... what happened when Vista was released? Oh yeah... people were forced
      to throw their pre-2005 dotNet stuff away...
      No they weren't.... You sure like to exagerate. The frameworks, are
      supported under Vista - it's the IDE's that aren't supported. Big difference.
      Unless your talking about the DEP installation failure? There is a work
      around for that you know....
      VB6 still has support until
      Win2008 server dies... what is that... 12 more years?
      >
      Wasn't Vista supposed to be "The dotNet OS"?... yeah, 2% dotNet, if that.
      >
      There was some talk of that in early beta's. Didn't happen. What difference
      does it make. Vista/2008 ship with the 3.0 framework.
      >>But, like I said... you guys can have these freaking groups.
      >>
      >Thank you, your too kind.
      >
      You're welcome... ya' know... after all of the dotNet trolls going to the
      VB6 groups and spouting their "evangelist " crap, I thought you guys might
      want some of the same medicine... I'll pop in and rattle a few cages now and
      then.... that is, if you don't mind... if you do mind, I can show you how to
      block senders, if that helps.
      >
      Oh, by all means keep it up. I don't mind a little lively conversation now
      and again :)
      It still cracks me up that Delphi and COBOL code can run nearly unchanged in
      dotNet, yet VB code can't.... shouldn't really be a surprise though, since
      Anders Hejlsberg had probably never seen VB and Paul "I'm the father of VB"
      Vick has never touched pre-dotNet VB code at all. The blind leading the
      blind. Simple as that.
      >
      Have fun... check in next week... same time, same channel.
      See you latter.

      --
      Tom Shelton

      Comment

      • Ken Halter

        #33
        Re: Conversion Problem

        "Tom Shelton" <tom_shelton@co mcastXXXXXXX.ne twrote in message
        news:btqdnQ-VaImePerVnZ2dnU VZ_gydnZ2d@comc ast.com...
        >>
        >
        Oh, please. VB6 sixes help sucks rocks. VB5 had the last decent help.
        The
        internet has been the primary source of real help for years.
        ....oh... and, if you still have VB6, drop a control on the form, select it
        and hit F1. That will take you to the help for that control, showing all
        events, properties and methods. Select any property in the property window,
        hit F1. Help will open and show sample code to use that property. Open the
        object browser and select any property/method/event... hit F1. If that
        doesn't show help, your environment's trashed or it's a 3rd party object
        that never had context sensitive help.
        >>Duh, I said that was one of the reasons for control arrays? In VB.NET,
        >>they
        >>don't have to be a control array and they don't have to be the same
        >>type.
        >>Or
        >>are you claiming that you can have the same event procedure handle the
        >>TextChanged event of a combobox and a textbox in VB6?
        >>
        >ummm... yes I am... I'm not sure why this is such a surprise. Have you
        >never
        >coded a sub to be called from multiple places? What difference does it
        >make
        >where the change event's coming from, or even what control fired it? If
        >that's so important, pass the control to the sub. No big deal. geez.
        >>
        >
        So, you admit that the SAME event procedure can NOT handle the same event
        for
        diffent individual controls (not control arrays) or differing types of
        controls... Thanks.
        So, you admit there's no benefit to using the same event handler for
        multiple controls when the functionality has been there for what... 3
        decades?... Thanks.
        As for your work around, sure - used to do it all the time, still do as a
        matter of fact. It just depends on the task at hand. C#/VB.NET just adds
        an
        extra tool to my belt.
        We all know how a plumber looks when wearing too many tools on his belt.
        >>
        >Yeah, because it makes the code unreadable. My enter key works perfectly
        >and
        >I use it all the time.
        >
        You think:
        >
        Dim i As Integer = 10
        >
        Is unreadable? Wow.
        Yes I do. When scanning thru hundreds of lines of code, there should be a
        declarations section, an initialization section and a "working" section.
        Anything else is... well... spaghetti code, at best.
        >Dim i As Integer : I = 10 'is perfectly valid code in VB3,4,5,6 but no
        >one
        >uses that syntax because it's unreadable and (or should I say AndAlso)
        >leads
        >to bugs.
        >
        Because that syntax sucks. The new syntax, is cleaner, highly readable
        and
        IMHO, more clearly convey's the intent of the author - thereby leading to
        less bugs.
        That's the key right there.... "by the author"... the author can read it...
        right now, that is. In 5 years? A different developer? Maybe, maybe not.
        >While I'm at it, this "+=" and similar crap they've added to make C
        >programmers more comfortable. What a mess that is. I can't believe people
        >would rather save 2 freaking keystrokes than have easy to read code...
        >but,
        >I guess when you're in dotNet, every keystroke you can save counts,
        >right?
        >>
        >
        Again, you don't like it - don't use it, but don't try to force your
        strange
        sesne of readability on others.
        What ever Mr C programmer.
        >
        Again, a valid option. Hope it works for you, when the rest of the world
        moves on to distributed systems and 64-bit apps....
        Have fun... have you seen the poor excuses for a 64 bit OS? I've had 64 bit
        CPUs since they were released... *still* no drivers for most hardware. 128
        bit will be available before vendors ever get around to writing 64 bit
        drivers.... this is because *they too* don't like anyone to tell them they
        need to throw all of their previous work in the trash.
        >>>
        >>Your oppinion.
        >>
        >Mine and about 5 million others, yep.
        >
        Goody for them.
        Well... that says a lot. *you're* right and 5 million others are wrong.
        That's kinda what I figured. Thanks for clearing that up.
        >Set theButton = buttons(btnInde x)
        >>
        >
        Oh yea, Set. Another one of those idiotic VB.CLASSIC'isms , introduced as
        a
        bandaid to the whole default propety mess. You know, the feature that
        most
        proffesionals and MVP's discouraged people from using for years.
        Yep... default properties are a source of confusion and shouldn't be
        encouraged... look what MS did to "Label1.Cap tion ="... changed that to
        "Label1.Tex t" while 3rd party vendors continued to use .Caption... who's
        right? Why the change in the first place?
        >>
        >Check these groups. How many people say they've set their app for 2.0 but
        >the installation forces them to install 3.5?
        >
        Because they screwed up their installer. What does that have to do with
        .NET?
        Well... isn't "XCopy Deployment" and that "Click Once" junk part of the .Net
        sales pitch?
        >If you're having problems with Binary Compatibility and DLL Hell after
        >all
        >these years, I'm very sorry. Most of us have figured out how to deal with
        >those problems.
        >>
        >
        Just as most of us have figured out how to deal with framework
        installations.. . But, it didn't stop you from bringing that up, so I
        thought
        I'd just point out one of the flaws in VB6 installations. Nothing is
        perfect.
        Now, that's something we can all agree on... nothing's perfect.
        Yes, just as your statements were your opinion... It's just that mine are
        more grounded in reality and the current market - but, I guess that's what
        comes of not shackling myself to a product that's useful lifetime expired
        some
        time in the last decade.
        That "expired" stuff may be true where you work.. but, not here.
        >A toy... yep. One that helped MS "rule the world" in the 90's. btw, try
        >pasting a block of text in anything resembling an immediate window...
        >what
        >do you see? What ever it is, it's not what you pasted... now try
        >selecting
        >that block and pasting into the code window... didn't work at all, you
        >say?
        >Didn't think so.
        >>
        >
        What are you talking about?
        There's a key called Ctrl on your keyboard. There's also a "C" and a "V"

        A) Go to your code window
        B) Select a block of text. fyi, a "Block" is generally 2 or more lines of
        text, separated by CR/LF
        C) Copy that block to the clipboard by holding down the key called "Ctrl"
        and pressing "C"
        D) Find the immediate window
        E) Paste that block into the window by holding down the key called "Ctrl"
        and pressing "V"

        Is it still a block? Unchanged? Didn't think so...

        Now, do the reverse

        A) Go to your immediate window
        B) Select a block of text. fyi, a "Block" is generally 2 or more lines of
        text, separated by CR/LF
        C) Copy that block to the clipboard by holding down the key called "Ctrl"
        and pressing "C"
        D) Find the code window
        E) Paste that block into the window by holding down the key called "Ctrl"
        and pressing "V"

        Is it still a block? Unchanged? Didn't think so... in fact, it doesn't work
        at all.
        And no it doesn't have single procedure view. I'm sorry that you don't
        like
        that - but, you know what - I hate single procedure view. But, I'm sure
        if
        enough people requested it, it would have been added by now... Wait,
        maybe
        I'm not alone in hating single procedure view.
        That's where you're wrong. Plenty of people asked for it... including
        Microsoft Employees. How long would it have taken to implement? 30 minutes?
        Do they care? No.
        >>
        >Thanks for that. I appreciate that you've allowed me to continue to work
        >in
        >VB6... what happened when Vista was released? Oh yeah... people were
        >forced
        >to throw their pre-2005 dotNet stuff away...
        >
        No they weren't.... You sure like to exagerate. The frameworks, are
        supported under Vista - it's the IDE's that aren't supported. Big
        difference.
        I agree... big difference... especially when it's the IDE you're paying for,
        when you shell out your money.
        >>
        >Wasn't Vista supposed to be "The dotNet OS"?... yeah, 2% dotNet, if that.
        >>
        >
        There was some talk of that in early beta's. Didn't happen. What
        difference
        does it make. Vista/2008 ship with the 3.0 framework.
        Some talk <gLOL... that was the entire sales pitch... some talk... funny.


        Comment

        • J.B. Moreno

          #34
          Re: Conversion Problem

          Ken Halter <Ken_Halter@Use _Sparingly_Hotm ail.comwrote:
          It still cracks me up that Delphi and COBOL code can run nearly unchanged in
          dotNet, yet VB code can't.... shouldn't really be a surprise though, since
          Anders Hejlsberg had probably never seen VB and Paul "I'm the father of VB"
          Vick has never touched pre-dotNet VB code at all. The blind leading the
          blind. Simple as that.
          I wonder if anyone here has tried VB Migration Partner...it sounds
          interesting but there's no demo version now that the beta period has
          passed (and their web page doesn't even tell you how many hundreds of
          thousands of dollars it cost).

          --
          J.B. Moreno

          Comment

          • Ken Halter

            #35
            Re: Conversion Problem

            "Armin Zingler" <az.nospam@free net.dewrote in message
            news:eNfhqu64IH A.2060@TK2MSFTN GP02.phx.gbl...
            "Ken Halter" <Ken_Halter@Use _Sparingly_Hotm ail.comschrieb
            >re-wrote VB basically from the ground up
            >
            Luckily they did. Finally got rid of all the hacks.
            ....btw...

            hacks...in your code? Replaced by hacks.net? Doesn't take long to find posts
            in this very forum that show, no matter what language you're using, you can
            create junkware. You know... like that "VB Powerpack" non-sense? I thought
            it was hilarious that, when they released the new version, they stated...
            "An this actually works!" as if they knew their previous release was junk...
            well... current release = junk, too.

            Your reference to GoSub is quite telling... as were your comments about
            control arrays.

            Wonder why the "upgrade" group is a ghost town? Wonder why so many questions
            here in this group never get answered... hmmmm.

            But... no need to reply. I won't be around to read it (them?), so maybe you
            guys can take some time, stop playing "fan boys" and help answer all, or at
            least /some/, of the questions that go unanswered here. Not just the easy
            ones.... btw, never said I didn't "know" B# (know more than the average
            "newbie", but less than someone that's interested)... but I'll say I can't
            stand the IDE and programming environment... and I *really* *HATE* the word
            "evangelist " when it comes to their sales personnel... in a message from MS,
            they asked "who's your local evangelist?"... I replied... "I don't know and
            couldn't care less. This is a programming language, *not* a religion"


            Comment

            • Armin Zingler

              #36
              Re: Conversion Problem

              "Ken Halter" <Ken_Halter@Use _Sparingly_Hotm ail.comschrieb
              "Armin Zingler" <az.nospam@free net.dewrote in message
              news:eNfhqu64IH A.2060@TK2MSFTN GP02.phx.gbl...
              "Ken Halter" <Ken_Halter@Use _Sparingly_Hotm ail.comschrieb
              re-wrote VB basically from the ground up
              Luckily they did. Finally got rid of all the hacks.
              >
              ...btw...
              >
              hacks...in your code? Replaced by hacks.net?
              Which one?
              Doesn't take long to
              find posts in this very forum that show, no matter what language
              you're using, you can create junkware.
              I agree.
              You know... like that "VB Powerpack" non-sense?
              I don't know. Haven't used it.

              Your reference to GoSub is quite telling... as were your comments
              about control arrays.
              I mentioned facts only. You were not able to answer my questions. Or you
              just didn't want to admit that I was right.

              Wonder why the "upgrade" group is a ghost town? Wonder why so many
              questions here in this group never get answered... hmmmm.
              Not answered? Even I answered thousands of them. *LOL*
              But... no need to reply.
              Sorry, too late.
              This is a programming language, *not* a religion"
              So why are you making a religious question out of it instead of just seeing
              the facts?



              Armin

              Comment

              • Just_a_fan@home.net

                #37
                Re: Re: Conversion Problem

                If you don't miss control arrays, look at what I had to do to account
                for them being missing (caution, this is ugly). Could have been handled
                in about 3 statements in VB6! I have 42 controls so 84 clauses in the
                "Handles" string to catch all of the click and ValueChanged events. Then
                this has to call another routine after figuring out who called this one.
                DUMB!!!!!! Here is what the "VB Team" has done for us:

                Thanks?

                -----------------------------------------------

                Sub AlarmChanged(By Val sender As System.Object, ByVal e As
                System.EventArg s) _
                Handles Alarm1.ValueCha nged, Alarm2.ValueCha nged, Alarm3.ValueCha nged,
                Alarm4.ValueCha nged, Alarm5.ValueCha nged, _
                Alarm6.ValueCha nged, Alarm7.ValueCha nged, Alarm8.ValueCha nged,
                Alarm9.ValueCha nged, Alarm10.ValueCh anged, _
                Alarm11.ValueCh anged, Alarm12.ValueCh anged, Alarm13.ValueCh anged,
                Alarm14.ValueCh anged, Alarm15.ValueCh anged, _
                Alarm16.ValueCh anged, Alarm17.ValueCh anged, Alarm18.ValueCh anged,
                Alarm19.ValueCh anged, Alarm20.ValueCh anged, _
                Alarm21.ValueCh anged, Alarm22.ValueCh anged, Alarm23.ValueCh anged,
                Alarm24.ValueCh anged, Alarm25.ValueCh anged, _
                Alarm26.ValueCh anged, Alarm27.ValueCh anged, Alarm28.ValueCh anged,
                Alarm29.ValueCh anged, Alarm30.ValueCh anged, _
                Alarm31.ValueCh anged, Alarm32.ValueCh anged, Alarm33.ValueCh anged,
                Alarm34.ValueCh anged, Alarm35.ValueCh anged, _
                Alarm36.ValueCh anged, Alarm37.ValueCh anged, Alarm38.ValueCh anged,
                Alarm39.ValueCh anged, Alarm30.ValueCh anged, _
                Alarm41.ValueCh anged, Alarm42.ValueCh anged, _
                Alarm1.Click, Alarm2.Click, Alarm3.Click, Alarm4.Click, Alarm5.Click,
                _
                Alarm6.Click, Alarm7.Click, Alarm8.Click, Alarm9.Click, Alarm10.Click,
                _
                Alarm11.Click, Alarm12.Click, Alarm13.Click, Alarm14.Click,
                Alarm15.Click, _
                Alarm16.Click, Alarm17.Click, Alarm18.Click, Alarm19.Click,
                Alarm20.Click, _
                Alarm21.Click, Alarm22.Click, Alarm23.Click, Alarm24.Click,
                Alarm25.Click, _
                Alarm26.Click, Alarm27.Click, Alarm28.Click, Alarm29.Click,
                Alarm30.Click, _
                Alarm31.Click, Alarm32.Click, Alarm33.Click, Alarm34.Click,
                Alarm35.Click, _
                Alarm36.Click, Alarm37.Click, Alarm38.Click, Alarm39.Click,
                Alarm30.Click, _
                Alarm41.Click, Alarm42.Click

                If bIgnoreClicks Then Exit Sub

                If sender.Equals(A larm1) Then : CheckAlarmVsWar n(Warn1, Alarm1) :
                Exit Sub
                ElseIf sender.Equals(A larm2) Then : CheckAlarmVsWar n(Warn2, Alarm2)
                : Exit Sub
                ElseIf sender.Equals(A larm3) Then : CheckAlarmVsWar n(Warn3, Alarm3)
                : Exit Sub
                ElseIf sender.Equals(A larm4) Then : CheckAlarmVsWar n(Warn4, Alarm4)
                : Exit Sub
                ElseIf sender.Equals(A larm5) Then : CheckAlarmVsWar n(Warn5, Alarm5)
                : Exit Sub
                ElseIf sender.Equals(A larm6) Then : CheckAlarmVsWar n(Warn6, Alarm6)
                : Exit Sub
                ElseIf sender.Equals(A larm7) Then : CheckAlarmVsWar n(Warn7, Alarm7)
                : Exit Sub
                ElseIf sender.Equals(A larm8) Then : CheckAlarmVsWar n(Warn8, Alarm8)
                : Exit Sub
                ElseIf sender.Equals(A larm9) Then : CheckAlarmVsWar n(Warn9, Alarm9)
                : Exit Sub
                ElseIf sender.Equals(A larm10) Then : CheckAlarmVsWar n(Warn10,
                Alarm10) : Exit Sub
                ElseIf sender.Equals(A larm11) Then : CheckAlarmVsWar n(Warn11,
                Alarm11) : Exit Sub
                ElseIf sender.Equals(A larm12) Then : CheckAlarmVsWar n(Warn12,
                Alarm12) : Exit Sub
                ElseIf sender.Equals(A larm13) Then : CheckAlarmVsWar n(Warn13,
                Alarm13) : Exit Sub
                ElseIf sender.Equals(A larm14) Then : CheckAlarmVsWar n(Warn14,
                Alarm14) : Exit Sub
                ElseIf sender.Equals(A larm15) Then : CheckAlarmVsWar n(Warn15,
                Alarm15) : Exit Sub
                ElseIf sender.Equals(A larm16) Then : CheckAlarmVsWar n(Warn16,
                Alarm16) : Exit Sub
                ElseIf sender.Equals(A larm17) Then : CheckAlarmVsWar n(Warn17,
                Alarm17) : Exit Sub
                ElseIf sender.Equals(A larm18) Then : CheckAlarmVsWar n(Warn18,
                Alarm18) : Exit Sub
                ElseIf sender.Equals(A larm19) Then : CheckAlarmVsWar n(Warn19,
                Alarm19) : Exit Sub
                ElseIf sender.Equals(A larm20) Then : CheckAlarmVsWar n(Warn20,
                Alarm20) : Exit Sub
                ElseIf sender.Equals(A larm21) Then : CheckAlarmVsWar n(Warn21,
                Alarm21) : Exit Sub
                ElseIf sender.Equals(A larm22) Then : CheckAlarmVsWar n(Warn22,
                Alarm22) : Exit Sub
                ElseIf sender.Equals(A larm23) Then : CheckAlarmVsWar n(Warn23,
                Alarm23) : Exit Sub
                ElseIf sender.Equals(A larm24) Then : CheckAlarmVsWar n(Warn24,
                Alarm24) : Exit Sub
                ElseIf sender.Equals(A larm25) Then : CheckAlarmVsWar n(Warn25,
                Alarm25) : Exit Sub
                ElseIf sender.Equals(A larm26) Then : CheckAlarmVsWar n(Warn26,
                Alarm26) : Exit Sub
                ElseIf sender.Equals(A larm27) Then : CheckAlarmVsWar n(Warn27,
                Alarm27) : Exit Sub
                ElseIf sender.Equals(A larm28) Then : CheckAlarmVsWar n(Warn28,
                Alarm28) : Exit Sub
                ElseIf sender.Equals(A larm29) Then : CheckAlarmVsWar n(Warn29,
                Alarm29) : Exit Sub
                ElseIf sender.Equals(A larm30) Then : CheckAlarmVsWar n(Warn30,
                Alarm30) : Exit Sub
                ElseIf sender.Equals(A larm31) Then : CheckAlarmVsWar n(Warn31,
                Alarm31) : Exit Sub
                ElseIf sender.Equals(A larm32) Then : CheckAlarmVsWar n(Warn32,
                Alarm32) : Exit Sub
                ElseIf sender.Equals(A larm33) Then : CheckAlarmVsWar n(Warn33,
                Alarm33) : Exit Sub
                ElseIf sender.Equals(A larm34) Then : CheckAlarmVsWar n(Warn34,
                Alarm34) : Exit Sub
                ElseIf sender.Equals(A larm35) Then : CheckAlarmVsWar n(Warn35,
                Alarm35) : Exit Sub
                ElseIf sender.Equals(A larm36) Then : CheckAlarmVsWar n(Warn36,
                Alarm36) : Exit Sub
                ElseIf sender.Equals(A larm37) Then : CheckAlarmVsWar n(Warn37,
                Alarm37) : Exit Sub
                ElseIf sender.Equals(A larm38) Then : CheckAlarmVsWar n(Warn38,
                Alarm38) : Exit Sub
                ElseIf sender.Equals(A larm39) Then : CheckAlarmVsWar n(Warn39,
                Alarm39) : Exit Sub
                ElseIf sender.Equals(A larm40) Then : CheckAlarmVsWar n(Warn40,
                Alarm40) : Exit Sub
                ElseIf sender.Equals(A larm41) Then : CheckAlarmVsWar n(Warn41,
                Alarm41) : Exit Sub
                ElseIf sender.Equals(A larm42) Then : CheckAlarmVsWar n(Warn42,
                Alarm42) : Exit Sub
                End If

                End SubOn Thu, 10 Jul 2008 17:15:22 -0500, in
                microsoft.publi c.dotnet.langua ges.vb Tom Shelton
                <tom_shelton@co mcastXXXXXXX.ne twrote:
                >On 2008-07-10, John <no-email-supplied@nothin g.comwrote:
                >glad to know its not just me, i would not even have considered using vb8 but
                >i do like the new updated appearance and i was worried that eventually vb6
                >would not work with microsofts operating system updates.
                >>
                >practically everything i try and do that took a few seconds in vb6 takes
                >hours in this to sort out and then like this example i have spent nearly the
                >whole day trying to achieve something that cannot be done simply (the best
                >solution being create a vb6 dll to handle it (says it all really doesn't
                >it). I have many more examples, no contol arrays so you have to build them
                >at run time and spend hours trying to get the layout correct, - printing -
                >you cannot easily specify a new page without going into a recursive print
                >handler which takes more time trying to handle your printing, etc etc all
                >simple stuff but a nightmare in this product.
                >>
                >
                >LOL... The problem is John, that you are not familiar enough with the
                >framework and .NET. Once you become so, on the whole things are MUCH easier
                >then VB6. I know, I spent years doing VB work. I'm not claiming every thing
                >is easier, just most.
                >
                >Your example of control arrays is pretty funny - I
                >don't even miss them. First off, the main reason in VB.CLASSIC for control
                >arrays was 1) common event handling and 2) avoiding the 256 unique control
                >names per form limit (or was it 255?). 2 doesn't apply in VB.NET and 1 is
                >handled by the fact that VB.NET events allow an event to be assigned to
                >multiple controls (heck, they don't even have to be the same type)...
                >
                >' you can do this in the ide - just select all of the controls you want, go
                >' to the event tab in the properties window and add the handler - the ide will
                >' automatically add the handles list :)
                >Private Sub Button_Click (ByVal sender As Object, ByVal e As EventArgs) _
                > Handles Button1.Click, Button2.Click, Button3.Click
                >
                Dim clickedButton As Button = DirectCast (sender, Button)
                ' do button stuff
                >End Sub
                >
                >There are times that using index's to access a control are helpful... And
                >even that is a fairly simple task.
                >
                >Public Class MyForm
                Inherits System.Windows. Forms.Form
                >
                Private buttons() As Button = new Button() {Button1, Button2, Button3}
                >
                ...
                >
                Private Sub DoCoolStuff(ByV al btnIndex As Integer)
                Dim theButton As Button = buttons(btnInde x)
                ' do cool stuff with the button
                End Sub
                >End Class
                >
                >Or you can index them from the containser controls collection at runtime by
                >the name:
                >
                >Dim theButton As Button = DirectCast(Me.C ontrols("theBut ton"), Button)
                >
                >There is no need to dynamically generate controls... You just have to
                >understand the differences and the capabilites of VB.NET and then you don't
                >have these types of issues (well, at least not as often).
                >
                >As for your file issue, I only was half joking about your file access - the
                >fact is that .NET is a different target platform then VB6. VB6 targeted COM
                >and so it has a lot of COM'isms - such as SafeArrays - and so in some ways is
                >not compatable. Personally, if I were you I would create a VB6 component that
                >would be able to convert the files into a more .NET friendly format and then
                >access them using the System.IO namespace classes. The FileXXX VB.NET native
                >functions are crap...

                Comment

                • Just_a_fan@home.net

                  #38
                  Re: Re: Conversion Problem

                  You forgot to add that you can do absolutely everything in VB.NET at
                  LEAST 2 ways and some of them have more ways than that to do the same
                  thing. WHY??? Never will know.

                  It adds to the complexity and makes the IDE and projects, even small
                  ones take a very long time to load bringing in thousands of those
                  multiple ways to do one thing. So also thanks for slowing everything
                  down.

                  Mike

                  On Fri, 11 Jul 2008 07:45:49 -0700, in
                  microsoft.publi c.dotnet.langua ges.vb "Ken Halter"
                  <Ken_Halter@Use _Sparingly_Hotm ail.comwrote:
                  >"Tom Shelton" <tom_shelton@co mcastXXXXXXX.ne twrote in message
                  >news:3rmdnZmPI 7VnFOvVnZ2dnUVZ _qXinZ2d@comcas t.com...
                  >On 2008-07-10, John <no-email-supplied@nothin g.comwrote:
                  >>
                  >LOL... The problem is John, that you are not familiar enough with the
                  >framework and .NET. Once you become so, on the whole things are MUCH
                  >easier
                  >
                  >...and he's not familiar with the framework because the help system sucks
                  >like a hoover.
                  >
                  >then VB6. I know, I spent years doing VB work. I'm not claiming every
                  >thing
                  >is easier, just most.
                  >>
                  >Your example of control arrays is pretty funny - I
                  >don't even miss them. First off, the main reason in VB.CLASSIC for
                  >control
                  >arrays was 1) common event handling and 2) avoiding the 256 unique control
                  >names per form limit (or was it 255?). 2 doesn't apply in VB.NET and 1 is
                  >
                  >256... and we can see "2 doesn't apply" from the over-bloated, "feature
                  >rich" (aka bug fest) apps people create with dotNet.
                  >
                  >handled by the fact that VB.NET events allow an event to be assigned to
                  >multiple controls (heck, they don't even have to be the same type)...
                  >
                  >...and, you're saying that's not possible in VB5/6? If so, you may not be as
                  >"great" as you assume.
                  >
                  >>
                  >Public Class MyForm
                  > Inherits System.Windows. Forms.Form
                  >>
                  > Private buttons() As Button = new Button() {Button1, Button2, Button3}
                  >
                  >Too bad that's not VB syntax. It's B#... I've been using basic and assembler
                  >since 1981 and basic has *never* used curly braces. That's "C".... plus,
                  >when the app is done, the code is readable in basic (and assembler)... not
                  >that framework/linq/xml crap.... guess what... linq or any variant of SQL is
                  >*NOT* part of any basic language that makes sense. That's SQL syntax and
                  >should stay as such. No use adding hundreds of keywords to an already
                  >over-bloated environment
                  >
                  > ..
                  >>
                  > Private Sub DoCoolStuff(ByV al btnIndex As Integer)
                  > Dim theButton As Button = buttons(btnInde x)
                  >
                  >Very readable.... NOT
                  >>
                  >As for your file issue, I only was half joking about your file access -
                  >the
                  >fact is that .NET is a different target platform then VB6. VB6 targeted
                  >COM
                  >
                  >...so, it worked. Which version(s) of the framework do your users need to
                  >download? Microsoft surely doesn't make things easier on the developer. That
                  >went away when VS6 did... and, if the whole mess is so freaking "wonderful" ,
                  >why do they have to give it away free? You can still buy legit copies of
                  >VS6, but be prepared to pay more than VS2008 costs... but, if you want what
                  >you pay for, grab VS6
                  >
                  >Even after... what... 7? 8 Years? No one knows what to call this "B#"... is
                  >it VB.Net? is it VB#? How about B#? or maybe it's VB8? VB9? What ever. Have
                  >fun.
                  >
                  >and so it has a lot of COM'isms - such as SafeArrays - and so in some ways
                  >is
                  >not compatable. Personally, if I were you I would create a VB6 component
                  >that
                  >would be able to convert the files into a more .NET friendly format and
                  >then
                  >
                  >Yeah... or maybe just write the thing in VB6 and go on to the next job, eh?
                  >
                  >But, like I said... you guys can have these freaking groups.
                  >

                  Comment

                  • Just_a_fan@home.net

                    #39
                    Re: Re: Conversion Problem

                    I have an app which won't run on any other system. It blows up before
                    my first line of code runs so I have NO idea what is wrong and NO idea
                    how to fix it.

                    I have sent in the dumps but no one has said anything to me. No one can
                    fix it here or anywhere and seven months later, I STILL cannot
                    distribute the program to ANYONE and have it run!

                    How's that for unstable?!?!

                    Mike

                    On Fri, 11 Jul 2008 10:16:58 -0700, in
                    microsoft.publi c.dotnet.langua ges.vb "Ken Halter"
                    <Ken_Halter@Use _Sparingly_Hotm ail.comwrote:
                    >"Tom Shelton" <tom_shelton@co mcastXXXXXXX.ne twrote in message
                    >news:j-GdnXjfwMOVFOrVn Z2dnUVZ_v_inZ2d @comcast.com...
                    >On 2008-07-11, Ken Halter <Ken_Halter@Use _Sparingly_Hotm ail.comwrote:
                    >>>
                    >>...and he's not familiar with the framework because the help system sucks
                    >>like a hoover.
                    >>>
                    >>
                    >Please! And VB6's doesn't? MS help has sucked for years - fortunately,
                    >there's this thing called the Internet....
                    >
                    >Yeah... in dotNet, the internet is required. Not so for VB6 and its version
                    >of MSDN.... but, it makes sense the internet's required since MS
                    >specifically added .NET to the name. It's a web app generator. Now, if I
                    >were creating web apps, or even apps for a mobile device, I surely wouldn't
                    >use VB5/6... but for desktop apps I surely wouldn't want to use dotNet.
                    >
                    >Duh, I said that was one of the reasons for control arrays? In VB.NET,
                    >they
                    >don't have to be a control array and they don't have to be the same type.
                    >Or
                    >are you claiming that you can have the same event procedure handle the
                    >TextChanged event of a combobox and a textbox in VB6?
                    >
                    >ummm... yes I am... I'm not sure why this is such a surprise. Have you never
                    >coded a sub to be called from multiple places? What difference does it make
                    >where the change event's coming from, or even what control fired it? If
                    >that's so important, pass the control to the sub. No big deal. geez.
                    >
                    >>Too bad that's not VB syntax. It's B#... I've been using basic and
                    >>assembler
                    >>since 1981 and basic has *never* used curly braces.
                    >>
                    >VB never had array or variable initialization on the same line before
                    >either... A feature was added, and a syntax was chosen. Get over it.
                    >
                    >Yeah, because it makes the code unreadable. My enter key works perfectly and
                    >I use it all the time.
                    >
                    >Dim i As Integer : I = 10 'is perfectly valid code in VB3,4,5,6 but no one
                    >uses that syntax because it's unreadable and (or should I say AndAlso) leads
                    >to bugs.
                    >
                    >While I'm at it, this "+=" and similar crap they've added to make C
                    >programmers more comfortable. What a mess that is. I can't believe people
                    >would rather save 2 freaking keystrokes than have easy to read code... but,
                    >I guess when you're in dotNet, every keystroke you can save counts, right?
                    >
                    >>*NOT* part of any basic language that makes sense.
                    >>
                    >You don't like LINQ - don't use it.
                    >
                    >Thanks for the option... Don't like dotBloat either... so I don't use it.
                    >HTH
                    >
                    >>That's SQL syntax and
                    >>should stay as such. No use adding hundreds of keywords to an already
                    >>over-bloated environment
                    >>
                    >Your oppinion.
                    >
                    >Mine and about 5 million others, yep.
                    >>>
                    >>Very readable.... NOT
                    >>
                    >What? As opposed to:
                    >>
                    >Dim theButton As Button
                    >theButton = buttons(btnInde x)
                    >>
                    >Sorry, but I think I like the one line rather then two bit.
                    >
                    >If that was supposed to be VB syntax, you forgot the Set keyword.. the code
                    >you posted would attempt to pass the default property of those controls back
                    >and forth.
                    >
                    >Set theButton = buttons(btnInde x)
                    >
                    >>Which version(s) of the framework do your users need to
                    >>download?
                    >>
                    >Which ever version my app needs. That's sort of a stupid question - how
                    >many
                    >Visual Basic runtimes are there? Oh, yeah one for every version.... And,
                    >well were at it lets have a discussion about binary compatability, and dll
                    >hell.
                    >
                    >Check these groups. How many people say they've set their app for 2.0 but
                    >the installation forces them to install 3.5?
                    >
                    >If you're having problems with Binary Compatibility and DLL Hell after all
                    >these years, I'm very sorry. Most of us have figured out how to deal with
                    >those problems.
                    >
                    >>Microsoft surely doesn't make things easier on the developer. That
                    >>went away when VS6 did... and, if the whole mess is so freaking
                    >>"wonderful" ,
                    >>why do they have to give it away free? You can still buy legit copies of
                    >>VS6, but be prepared to pay more than VS2008 costs... but, if you want
                    >>what
                    >>you pay for, grab VS6
                    >>>
                    >>
                    >They give it away for very good reasons. VS's current competition is
                    >almost
                    >all FREE. It's a market difference, and not a reflection on the quality
                    >of
                    >the product.
                    >
                    >In your opinion.
                    >
                    >>>
                    >>Yeah... or maybe just write the thing in VB6 and go on to the next job,
                    >>eh?
                    >>>
                    >>
                    >LOL... Yeah right. VB6 was a great tool in it's day, but compared to
                    >.NET
                    >it's a toy. To do anything of more then average complexity requires
                    >jumping
                    >
                    >A toy... yep. One that helped MS "rule the world" in the 90's. btw, try
                    >pasting a block of text in anything resembling an immediate window... what
                    >do you see? What ever it is, it's not what you pasted... now try selecting
                    >that block and pasting into the code window... didn't work at all, you say?
                    >Didn't think so.
                    >
                    >Now, try looking at only one procedure in your app.... collapse everything
                    >yet? Can you name a single app in the world that requires its users to edit
                    >text in a treeview? Without an option to turn it off? How about an option to
                    >view a single procedure at a time, without jumping through those dreadful
                    >hoops. Ain't gonna happen? That's because the design team doesn't care. It's
                    >their way or the highway.
                    >
                    >through some major hoops, which often if not done properly lead to crashes
                    >and
                    >hard to find instabilities. I can't tell you how often I read posts over
                    >in
                    >
                    >Hard to find instabilities.. . and you're questioning someone elses coding
                    >abilities? mmmkay. What ever... btw... in the computer world, if *anything*
                    >isn't "done properly", you'll get the same results.
                    >
                    >the classic group that have long complicated answers delving deep in to
                    >the
                    >API, that are solved in .NET apps in a couple of lines of code. But, if
                    >you
                    >like dealing in complexity (aka bug riddled apps) then by all means, keep
                    >clinging to your out of date toy environment...
                    >
                    >Thanks for that. I appreciate that you've allowed me to continue to work in
                    >VB6... what happened when Vista was released? Oh yeah... people were forced
                    >to throw their pre-2005 dotNet stuff away... VB6 still has support until
                    >Win2008 server dies... what is that... 12 more years?
                    >
                    >Wasn't Vista supposed to be "The dotNet OS"?... yeah, 2% dotNet, if that.
                    >
                    >>But, like I said... you guys can have these freaking groups.
                    >>
                    >Thank you, your too kind.
                    >
                    >You're welcome... ya' know... after all of the dotNet trolls going to the
                    >VB6 groups and spouting their "evangelist " crap, I thought you guys might
                    >want some of the same medicine... I'll pop in and rattle a few cages now and
                    >then.... that is, if you don't mind... if you do mind, I can show you how to
                    >block senders, if that helps.
                    >
                    >It still cracks me up that Delphi and COBOL code can run nearly unchanged in
                    >dotNet, yet VB code can't.... shouldn't really be a surprise though, since
                    >Anders Hejlsberg had probably never seen VB and Paul "I'm the father of VB"
                    >Vick has never touched pre-dotNet VB code at all. The blind leading the
                    >blind. Simple as that.
                    >
                    >Have fun... check in next week... same time, same channel.
                    >

                    Comment

                    • Just_a_fan@home.net

                      #40
                      Re: Re: Conversion Problem

                      On Fri, 11 Jul 2008 15:49:32 -0500, in
                      microsoft.publi c.dotnet.langua ges.vb Tom Shelton
                      <tom_shelton@co mcastXXXXXXX.ne twrote:
                      >All of which works in VS as well... What I, thought we were talking about was
                      >the actual quality of the help - not the mechanism for obtaining it.
                      Well, not quite "all". I get screwy messages from time to time. The
                      last one I got refers to not being able to use a lamda or query
                      statement. Try figuring out what a lamda statement is from the help. I
                      never did! I looked all around and still have no idea what a lamda
                      statement is and I don't use any query statements or databases in the
                      entire program so WHAT is it complaining about and WHY can't I find out
                      what the problem is? Don't know! Never will!

                      Pressing F1 brings up a LOT of stuff when I really want help on the
                      control. Sometimes I finally "drill down" to it, sometimes not. And
                      sometimes it tells me that I don't have the right password for 3 days,
                      and then starts working again on the fourth day. During that time, it
                      did not allow me to put in a userid or password and refused to work.
                      What's that about???? And why did it start working again??? No idea!
                      Never will know!

                      We got a lot but we gave back MORE! (single procedure view, procedures
                      sorted by name, now have completely cryptic "help" messages of no help
                      at all, SPEED has gone away, both IDE starting and apps starting, SO
                      MUCH MORE!)

                      Mike

                      Comment

                      • Just_a_fan@home.net

                        #41
                        Re: Re: Conversion Problem

                        On Fri, 11 Jul 2008 15:10:08 -0700, in
                        microsoft.publi c.dotnet.langua ges.vb "Ken Halter"
                        <Ken_Halter@Use _Sparingly_Hotm ail.comwrote:
                        >quality of answer = quality of question
                        Trouble is, M$ creates the question and THERE IS NO ANSWER!

                        See previous post about lamda statements (whatever they are) referenced
                        in a M$ error message.

                        Mike

                        Comment

                        • Armin Zingler

                          #42
                          Re: Re: Conversion Problem

                          <Just_a_fan@hom e.netschrieb
                          If you don't miss control arrays, look at what I had to do
                          You can still put controls into an array once. Takes 2 minutes. Handle them
                          in a loop, for example when using Addhandler. Yes, little more work than in
                          VB6, but...

                          ....how could I make it in VB6 to give each Alarm control an individual
                          meaningful name and handle an event of all of them in the same procedure? I
                          had to write 42 event handlers!


                          Armin

                          Comment

                          • Stephany Young

                            #43
                            Re: Re: Conversion Problem

                            Oh it's such a bummer when big bad Microsoft makes things so difficult for
                            you isn't it!!!!

                            Instead of spitting your dummy, hit the F1 key and find one of the numerous
                            examples for dealing with arrays of various types of objects, or for that
                            matter Generic List's of various types of objects.

                            The following tok a whole 4 minutes:

                            Private m_alarm As New List(Of Alarm)
                            Private m_warn As New List(Of Warn)

                            Private Sub Form1_Load(ByVa l sender As Object, ByVal e As
                            System.EventArg s) Handles Me.Load

                            For _i = 1 To 42
                            m_alarm.Add(CTy pe(Controls.Fin d(String.Format ("Alarm{0}", _i),
                            True)(0), Alarm))
                            AddHandler m_alarm(_i).Val ueChanged, AddressOf AlarmChanged
                            ' Add other event handler subscriptions here if necessary
                            m_warn.Add(CTyp e(Controls.Find (String.Format( "Warn{0}", _i), True)(0),
                            Warn))
                            ' Add event handler subscriptions here if necessary
                            Next

                            End Sub

                            Private Sub AlarmChanged(By Val sender As Object, ByVal e As EventArgs)

                            If Not bIgnoreClicks Then
                            Dim _i = m_alarm.IndexOf (CType(sender, Alarm))
                            CheckAlarmVsWar n(m_warn(_i), m_alarm(_i))
                            End If

                            End Sub

                            Certainly, the example assumes that your controls named Alarm1 through
                            Alarm42 are actually controls of type Alarm and have already been added to
                            your form. Similarly it assumes that your objects named Warn1 through
                            Warn42 are controls of type Warn and have also been added to your form. if
                            not then simply tweak the example accordingly.

                            You must realise that there is more than one way of skinning a cat.


                            <Just_a_fan@hom e.netwrote in message
                            news:00d384plvo 30almg7aqbg1frp iqh133c1e@4ax.c om...
                            If you don't miss control arrays, look at what I had to do to account
                            for them being missing (caution, this is ugly). Could have been handled
                            in about 3 statements in VB6! I have 42 controls so 84 clauses in the
                            "Handles" string to catch all of the click and ValueChanged events. Then
                            this has to call another routine after figuring out who called this one.
                            DUMB!!!!!! Here is what the "VB Team" has done for us:
                            >
                            Thanks?
                            >
                            -----------------------------------------------
                            >
                            Sub AlarmChanged(By Val sender As System.Object, ByVal e As
                            System.EventArg s) _
                            Handles Alarm1.ValueCha nged, Alarm2.ValueCha nged, Alarm3.ValueCha nged,
                            Alarm4.ValueCha nged, Alarm5.ValueCha nged, _
                            Alarm6.ValueCha nged, Alarm7.ValueCha nged, Alarm8.ValueCha nged,
                            Alarm9.ValueCha nged, Alarm10.ValueCh anged, _
                            Alarm11.ValueCh anged, Alarm12.ValueCh anged, Alarm13.ValueCh anged,
                            Alarm14.ValueCh anged, Alarm15.ValueCh anged, _
                            Alarm16.ValueCh anged, Alarm17.ValueCh anged, Alarm18.ValueCh anged,
                            Alarm19.ValueCh anged, Alarm20.ValueCh anged, _
                            Alarm21.ValueCh anged, Alarm22.ValueCh anged, Alarm23.ValueCh anged,
                            Alarm24.ValueCh anged, Alarm25.ValueCh anged, _
                            Alarm26.ValueCh anged, Alarm27.ValueCh anged, Alarm28.ValueCh anged,
                            Alarm29.ValueCh anged, Alarm30.ValueCh anged, _
                            Alarm31.ValueCh anged, Alarm32.ValueCh anged, Alarm33.ValueCh anged,
                            Alarm34.ValueCh anged, Alarm35.ValueCh anged, _
                            Alarm36.ValueCh anged, Alarm37.ValueCh anged, Alarm38.ValueCh anged,
                            Alarm39.ValueCh anged, Alarm30.ValueCh anged, _
                            Alarm41.ValueCh anged, Alarm42.ValueCh anged, _
                            Alarm1.Click, Alarm2.Click, Alarm3.Click, Alarm4.Click, Alarm5.Click,
                            _
                            Alarm6.Click, Alarm7.Click, Alarm8.Click, Alarm9.Click, Alarm10.Click,
                            _
                            Alarm11.Click, Alarm12.Click, Alarm13.Click, Alarm14.Click,
                            Alarm15.Click, _
                            Alarm16.Click, Alarm17.Click, Alarm18.Click, Alarm19.Click,
                            Alarm20.Click, _
                            Alarm21.Click, Alarm22.Click, Alarm23.Click, Alarm24.Click,
                            Alarm25.Click, _
                            Alarm26.Click, Alarm27.Click, Alarm28.Click, Alarm29.Click,
                            Alarm30.Click, _
                            Alarm31.Click, Alarm32.Click, Alarm33.Click, Alarm34.Click,
                            Alarm35.Click, _
                            Alarm36.Click, Alarm37.Click, Alarm38.Click, Alarm39.Click,
                            Alarm30.Click, _
                            Alarm41.Click, Alarm42.Click
                            >
                            If bIgnoreClicks Then Exit Sub
                            >
                            If sender.Equals(A larm1) Then : CheckAlarmVsWar n(Warn1, Alarm1) :
                            Exit Sub
                            ElseIf sender.Equals(A larm2) Then : CheckAlarmVsWar n(Warn2, Alarm2)
                            : Exit Sub
                            ElseIf sender.Equals(A larm3) Then : CheckAlarmVsWar n(Warn3, Alarm3)
                            : Exit Sub
                            ElseIf sender.Equals(A larm4) Then : CheckAlarmVsWar n(Warn4, Alarm4)
                            : Exit Sub
                            ElseIf sender.Equals(A larm5) Then : CheckAlarmVsWar n(Warn5, Alarm5)
                            : Exit Sub
                            ElseIf sender.Equals(A larm6) Then : CheckAlarmVsWar n(Warn6, Alarm6)
                            : Exit Sub
                            ElseIf sender.Equals(A larm7) Then : CheckAlarmVsWar n(Warn7, Alarm7)
                            : Exit Sub
                            ElseIf sender.Equals(A larm8) Then : CheckAlarmVsWar n(Warn8, Alarm8)
                            : Exit Sub
                            ElseIf sender.Equals(A larm9) Then : CheckAlarmVsWar n(Warn9, Alarm9)
                            : Exit Sub
                            ElseIf sender.Equals(A larm10) Then : CheckAlarmVsWar n(Warn10,
                            Alarm10) : Exit Sub
                            ElseIf sender.Equals(A larm11) Then : CheckAlarmVsWar n(Warn11,
                            Alarm11) : Exit Sub
                            ElseIf sender.Equals(A larm12) Then : CheckAlarmVsWar n(Warn12,
                            Alarm12) : Exit Sub
                            ElseIf sender.Equals(A larm13) Then : CheckAlarmVsWar n(Warn13,
                            Alarm13) : Exit Sub
                            ElseIf sender.Equals(A larm14) Then : CheckAlarmVsWar n(Warn14,
                            Alarm14) : Exit Sub
                            ElseIf sender.Equals(A larm15) Then : CheckAlarmVsWar n(Warn15,
                            Alarm15) : Exit Sub
                            ElseIf sender.Equals(A larm16) Then : CheckAlarmVsWar n(Warn16,
                            Alarm16) : Exit Sub
                            ElseIf sender.Equals(A larm17) Then : CheckAlarmVsWar n(Warn17,
                            Alarm17) : Exit Sub
                            ElseIf sender.Equals(A larm18) Then : CheckAlarmVsWar n(Warn18,
                            Alarm18) : Exit Sub
                            ElseIf sender.Equals(A larm19) Then : CheckAlarmVsWar n(Warn19,
                            Alarm19) : Exit Sub
                            ElseIf sender.Equals(A larm20) Then : CheckAlarmVsWar n(Warn20,
                            Alarm20) : Exit Sub
                            ElseIf sender.Equals(A larm21) Then : CheckAlarmVsWar n(Warn21,
                            Alarm21) : Exit Sub
                            ElseIf sender.Equals(A larm22) Then : CheckAlarmVsWar n(Warn22,
                            Alarm22) : Exit Sub
                            ElseIf sender.Equals(A larm23) Then : CheckAlarmVsWar n(Warn23,
                            Alarm23) : Exit Sub
                            ElseIf sender.Equals(A larm24) Then : CheckAlarmVsWar n(Warn24,
                            Alarm24) : Exit Sub
                            ElseIf sender.Equals(A larm25) Then : CheckAlarmVsWar n(Warn25,
                            Alarm25) : Exit Sub
                            ElseIf sender.Equals(A larm26) Then : CheckAlarmVsWar n(Warn26,
                            Alarm26) : Exit Sub
                            ElseIf sender.Equals(A larm27) Then : CheckAlarmVsWar n(Warn27,
                            Alarm27) : Exit Sub
                            ElseIf sender.Equals(A larm28) Then : CheckAlarmVsWar n(Warn28,
                            Alarm28) : Exit Sub
                            ElseIf sender.Equals(A larm29) Then : CheckAlarmVsWar n(Warn29,
                            Alarm29) : Exit Sub
                            ElseIf sender.Equals(A larm30) Then : CheckAlarmVsWar n(Warn30,
                            Alarm30) : Exit Sub
                            ElseIf sender.Equals(A larm31) Then : CheckAlarmVsWar n(Warn31,
                            Alarm31) : Exit Sub
                            ElseIf sender.Equals(A larm32) Then : CheckAlarmVsWar n(Warn32,
                            Alarm32) : Exit Sub
                            ElseIf sender.Equals(A larm33) Then : CheckAlarmVsWar n(Warn33,
                            Alarm33) : Exit Sub
                            ElseIf sender.Equals(A larm34) Then : CheckAlarmVsWar n(Warn34,
                            Alarm34) : Exit Sub
                            ElseIf sender.Equals(A larm35) Then : CheckAlarmVsWar n(Warn35,
                            Alarm35) : Exit Sub
                            ElseIf sender.Equals(A larm36) Then : CheckAlarmVsWar n(Warn36,
                            Alarm36) : Exit Sub
                            ElseIf sender.Equals(A larm37) Then : CheckAlarmVsWar n(Warn37,
                            Alarm37) : Exit Sub
                            ElseIf sender.Equals(A larm38) Then : CheckAlarmVsWar n(Warn38,
                            Alarm38) : Exit Sub
                            ElseIf sender.Equals(A larm39) Then : CheckAlarmVsWar n(Warn39,
                            Alarm39) : Exit Sub
                            ElseIf sender.Equals(A larm40) Then : CheckAlarmVsWar n(Warn40,
                            Alarm40) : Exit Sub
                            ElseIf sender.Equals(A larm41) Then : CheckAlarmVsWar n(Warn41,
                            Alarm41) : Exit Sub
                            ElseIf sender.Equals(A larm42) Then : CheckAlarmVsWar n(Warn42,
                            Alarm42) : Exit Sub
                            End If
                            >
                            End SubOn Thu, 10 Jul 2008 17:15:22 -0500, in
                            microsoft.publi c.dotnet.langua ges.vb Tom Shelton
                            <tom_shelton@co mcastXXXXXXX.ne twrote:
                            >
                            >>On 2008-07-10, John <no-email-supplied@nothin g.comwrote:
                            >>glad to know its not just me, i would not even have considered using vb8
                            >>but
                            >>i do like the new updated appearance and i was worried that eventually
                            >>vb6
                            >>would not work with microsofts operating system updates.
                            >>>
                            >>practically everything i try and do that took a few seconds in vb6 takes
                            >>hours in this to sort out and then like this example i have spent nearly
                            >>the
                            >>whole day trying to achieve something that cannot be done simply (the
                            >>best
                            >>solution being create a vb6 dll to handle it (says it all really doesn't
                            >>it). I have many more examples, no contol arrays so you have to build
                            >>them
                            >>at run time and spend hours trying to get the layout correct, -
                            >>printing -
                            >>you cannot easily specify a new page without going into a recursive
                            >>print
                            >>handler which takes more time trying to handle your printing, etc etc
                            >>all
                            >>simple stuff but a nightmare in this product.
                            >>>
                            >>
                            >>LOL... The problem is John, that you are not familiar enough with the
                            >>framework and .NET. Once you become so, on the whole things are MUCH
                            >>easier
                            >>then VB6. I know, I spent years doing VB work. I'm not claiming every
                            >>thing
                            >>is easier, just most.
                            >>
                            >>Your example of control arrays is pretty funny - I
                            >>don't even miss them. First off, the main reason in VB.CLASSIC for
                            >>control
                            >>arrays was 1) common event handling and 2) avoiding the 256 unique control
                            >>names per form limit (or was it 255?). 2 doesn't apply in VB.NET and 1 is
                            >>handled by the fact that VB.NET events allow an event to be assigned to
                            >>multiple controls (heck, they don't even have to be the same type)...
                            >>
                            >>' you can do this in the ide - just select all of the controls you want,
                            >>go
                            >>' to the event tab in the properties window and add the handler - the ide
                            >>will
                            >>' automatically add the handles list :)
                            >>Private Sub Button_Click (ByVal sender As Object, ByVal e As EventArgs) _
                            >Handles Button1.Click, Button2.Click, Button3.Click
                            >>
                            > Dim clickedButton As Button = DirectCast (sender, Button)
                            > ' do button stuff
                            >>End Sub
                            >>
                            >>There are times that using index's to access a control are helpful... And
                            >>even that is a fairly simple task.
                            >>
                            >>Public Class MyForm
                            > Inherits System.Windows. Forms.Form
                            >>
                            > Private buttons() As Button = new Button() {Button1, Button2, Button3}
                            >>
                            > ...
                            >>
                            > Private Sub DoCoolStuff(ByV al btnIndex As Integer)
                            > Dim theButton As Button = buttons(btnInde x)
                            > ' do cool stuff with the button
                            > End Sub
                            >>End Class
                            >>
                            >>Or you can index them from the containser controls collection at runtime
                            >>by
                            >>the name:
                            >>
                            >>Dim theButton As Button = DirectCast(Me.C ontrols("theBut ton"), Button)
                            >>
                            >>There is no need to dynamically generate controls... You just have to
                            >>understand the differences and the capabilites of VB.NET and then you
                            >>don't
                            >>have these types of issues (well, at least not as often).
                            >>
                            >>As for your file issue, I only was half joking about your file access -
                            >>the
                            >>fact is that .NET is a different target platform then VB6. VB6 targeted
                            >>COM
                            >>and so it has a lot of COM'isms - such as SafeArrays - and so in some ways
                            >>is
                            >>not compatable. Personally, if I were you I would create a VB6 component
                            >>that
                            >>would be able to convert the files into a more .NET friendly format and
                            >>then
                            >>access them using the System.IO namespace classes. The FileXXX VB.NET
                            >>native
                            >>functions are crap...

                            Comment

                            • Just_a_fan@home.net

                              #44
                              Re: Re: Re: Conversion Problem

                              In VB9 there are multiple ways to skin each cat. That's part of the
                              problem. Code bloat, more things to learn for no gain in function, more
                              things to break since there are multiple routines to run the multiple
                              ways one can do every function.

                              I will try your code. Thanks! Would be nice if it works. The controls
                              are updownnumeric controls. Both the Alarm and the Warn are
                              updownnumeric's . I hope this works with that kind of critter.

                              Surely wish they had SelectStart and SelectLength. They are bound to be
                              text boxes with an attached scroll bar type dongle added but then the
                              text handling is so weak that it might be something brand new with
                              insufficient code in it. I like to highlight the text when a control is
                              entered. Found I could not this time. It lowers the utility of the
                              control for me and my users.

                              Mike

                              On Sat, 19 Jul 2008 23:02:34 +1200, in
                              microsoft.publi c.dotnet.langua ges.vb "Stephany Young" <noone@localhos t>
                              wrote:
                              >You must realise that there is more than one way of skinning a cat.

                              Comment

                              Working...