"Rich P" <rp*****@aol.co mwrote in message
news:12******** *****@news.news feeds.com...
Hello,
The functionality you are trying to achieve with your code is not
supported in VBA because it requires a multithreaded environment
No, the simple code posted does not need threading. The looping is ONLY
there for re-prompting the user, not the requiremnt to span a new thread.
which
would involve programming in an Object Oriented Programming platform
No, opp and threading are separate issues. The idea, concpet and
implementation of a threaded language does not require that it be an object
oriented platform at all. The idea of having threaded code does not require
you to have a opp lanaguge.
(OOP -- C#, VB.Net, Java...). VBA is not Object Oriented -- it is
Interpreted.
I hate to burst your bubble but c#, and the .net actually now use a runtime
p-code system, and is in fact compiled down into a intermediate language
that is interpreted by the CLR (common language runtime). So in this case
C#, vb.net, and VBA actually are now all compiled to an intermediate
language, or what is called a p-code system. What this means is none of
these languages actually now compile down to into true .exe files that the
intel Processor can consume. This means that your file extension of .exe, or
mdb, or whatever you choose is in fact a moot point at this point in time
now.
It is interesting that us VBA developers for years and years have been using
a p-code interpreted system, and now both c# and vb.net use a similar
architecture.
The VBA compiler interprets the code as it runs thus not
requiring to compile the code into an exe which makes programming and
debugging as easy as can be.
Once again this is complete wrong. In fact debugging systems tend to work
better when you have an intermediate p-code language. While the dot net
compilers appear to produce a .exe file, this is actually not a true
compiled file, and is NOT a native executable file. In fact the.net
debugging systems use the p-code intermediate language to their benefit, and
not their detriment as you're suggesting.
VBA does have a compiler, and it does compile it down to a p-code lanague
that is then interpreted by runtime system. So, for all of the syntax error
checking, compiling, and removal of comments from the source code, this
process is much the same in VBA as it is now in .net.
The resulting compiled file in vb.net, or in ms-access results in a p-code
(intermediate language) that then gets executed an runtime system
.. c#, and vb.net (or any other language you use that converts into the
common runtime language) STILL requires you have the.net library or runtime
system installed to interpret that code. It is not natively compiled, and
therefore this also explains why you can do x-copy development in vb.net (or
in ms-access) after you've installed the appropriate libraries that can
interpret the code that gets created by these systems.
I should point out that c++, or the even the last version of visual basic
6.0 did have a native compiler, and these two systems could in fact produce
true .exe files that could be interpreted by the Intel processor direclty
(this is TRUE native .exe's now). These resulting files of course did
require access to the windows api, but there was not an intermediate
interpreter (p-code) system like you have with .net.
The limitation of Interpreted programming
code is that you can't perform OOP operations.
Once again this is wrong, because .net is *like* an interpreted language.
Java is considered a oop language, and it does not produce native
executables in most implementations either Once you've compiled to the
p-code system, then the idea here is that supposedly your code is platform
more portable. As long as you write a p-code interpreter for that platform,
all of your code should work.
I should point out this is also why it for example you can use visual studio
to produce .net code for the mobile edition of windows (which by the way,
does not have an Intel compatible processor), or the XNA for the xbox.
It is either one or the
other.
No, it is not one choice or the other when you choose an interpreted versus
that of a compiled language. OOP operations are not exclusive to compiled
languages only.
As I pointed out the .net system is in fact interpreted language system. I
should point of course that the CLR has its own compiler that is independent
of what language you program in. The CLR interpreter does in fact have a JIT
(just in time compiler) that'll eventually take that p-code and compiles it
into the native language of your machine (in this case the Intel processor),
So I will admit that how the CLR functions is not a true p-code architecture
in the classic sense of Java, or VBA.
I'm open to being corrected on this architecture issue, but it is my
assumption that your .exe files created by the .net library in is fact a CLR
p-code .exe, and is not a native true compiled language until the JIT gets
its hands on this .exe file. You can however pre compiled.net applications
using the ngen utility.
The issue of having a full opp language, or having a language that supports
threading, has no relationship to the fact if the language is a native
compiled language, or a p-code interpreted language at all.
**Both** both of those types of languages can well implement opp features,
and also that of threading.
I should point out the MS access does allow you to create and build your own
class objects. However, the vba in access is not considered a full opp
language because it's missing features like inheritance, and a number of
other things what would give it a full oop badge.
You can read my article on building and using class objects in MS access
here:
http://www.members.shaw.ca/AlbertKal.../WhyClass.html
Keep in mind that MS access shares the same compiler as vb 6.0 but simply
does not allow us to produce a native.exe like vb 6.0 did (vb 6 allowed the
creation of both native .exe executables, or the choice of using p-code --
Once again an issue that's been dependent of oop, or threading).
--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pl************* ****@msn.com