Re: Indirect referencing in VB6
From: Bonj (a_at_b.com)
Date: 04/28/04
- Next message: YYZ: "Re: How to create a table in Access via ado.net"
- Previous message: Bonj: "Re: Pragmatically compact and repair database"
- In reply to: Rick Rothstein: "Re: Indirect referencing in VB6"
- Next in thread: Rick Rothstein: "Re: Indirect referencing in VB6"
- Reply: Rick Rothstein: "Re: Indirect referencing in VB6"
- Reply: Tony Proctor: "Re: Indirect referencing in VB6"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 28 Apr 2004 19:21:47 +0100
It does use pointers though - what about when you pass a value byref, this
is the VB equivalent of a C/C++ program passing a pointer. If VB wants to
pass a long byref to an api, the C/C++ function has to be declared in the
DLL with long* (long pointer).
Thus, isn't it doing the same thing when it passes it to another of its own
functions?
"Rick Rothstein" <rickNOSPAMnews@NOSPAMcomcast.net> wrote in message
news:OCY97ZTLEHA.2976@TK2MSFTNGP10.phx.gbl...
> I know about pointers and 'C', but the whole language is structured for
> their use (for example, access to Strings, which are not "strings" in
> 'C', rather they are arrays). It is my understanding that C++ sort of
> discourages their use and doesn't suffer for it. VB, like PASCAL
> (another 'C' type derivative), doesn't use pointers at all and yet
> coding in both is not hampered by this either. My question was basically
> for the OP to cite a example (his code requirements) where this sort of
> indirection (in VB) would be useful and could not easily be handled
> using normal constructs.
>
> Rick - MVP
>
>
> "Tony Proctor" <tony_proctor@aimtechnology_NOSPAM_.com> wrote in message
> news:O20bEPTLEHA.2736@TK2MSFTNGP11.phx.gbl...
> > It's a style supported, and encouraged, in some other language systems
> > though Rick. In particular, pointer-based languages such as C do this
> all
> > the time. The only difference is that the linkage uses a binary
> address
> > rather than the symbolic name.
> >
> > Tony Proctor
> >
> > "Rick Rothstein" <rickNOSPAMnews@NOSPAMcomcast.net> wrote in message
> > news:eVvMshSLEHA.3516@TK2MSFTNGP11.phx.gbl...
> > > > Please tell me if there is a way to do this in VB6.
> > > >
> > > > I have a string variable. In this variable is the name of another
> > > variable.
> > > > Is there a way to access the contents of the 2nd variable through
> the
> > > first
> > > > without using an IF or SELECT to test for all possibilities?
> > > >
> > >
> > > > Dim strVar1 as String
> > > >
> > > > Dim strVar2 as string
> > > >
> > > > strVar2 = "Hello World!"
> > > >
> > > > strVar1 = "strVar2"
> > > >
> > > > Can I get the value of strVar2 by referencing strVar1? I could
> swear
> > > there's
> > > > a way to do it but I can't remember how! L
> > >
> > > You must be asking something deeper than the words you used to ask
> this
> > > question... doesn't simply
> > >
> > > strVar1 = strVar2
> > >
> > > do what you are asking? Or are you asking for some kind of permanent
> > > linkage so that after changing the contents of strVar2 somewhere
> inside
> > > of your program, strVar1 will automatically mirror that change
> without
> > > making the above direct assignment? If that is what you are after,
> no,
> > > VB doesn't do this. However, in 20+ years of programming in
> BASIC/VB, I
> > > can honestly say I've never come across the need to do this. What is
> > > your program doing (that is, what is it in your program's logic)
> that
> > > makes such a linkage necessary? Since I can't imagine the situation
> > > requiring this, I'd really like to know.
> > >
> > > Rick - MVP
> > >
> >
> >
>
- Next message: YYZ: "Re: How to create a table in Access via ado.net"
- Previous message: Bonj: "Re: Pragmatically compact and repair database"
- In reply to: Rick Rothstein: "Re: Indirect referencing in VB6"
- Next in thread: Rick Rothstein: "Re: Indirect referencing in VB6"
- Reply: Rick Rothstein: "Re: Indirect referencing in VB6"
- Reply: Tony Proctor: "Re: Indirect referencing in VB6"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|