Re: Trying to Learn VB

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Auric__ (not.my.real_at_email.address)
Date: 06/14/04


Date: Mon, 14 Jun 2004 13:12:49 -0700

On Mon, 14 Jun 2004 13:44:22 -0500, sowetoddid
<<sowetoddid.17ut3w@excelforum-nospam.com>> wrote:

>I have clicked on all of the links that I can find posted in this forum,
>trying to learn how to compile VB codes. A lot of the codes make
>sense, except for the extra info the gets stuck between lines. Does
>anyone know a good webpage that analyzes codes line by line, explaining
>what each part does?

No, but then, I never had reason to look. Try Googling for something
like:
    online "visual basic" "lexical analyzer"
(with quotes). I doubt you'll find anything, but it's worth a shot.

>What is the significance of...
>
>(Cancel As Boolean)

Read Mr. Phillips' msg.

>and
>
>(By Val SaveAsUI As Boolean, Cancel As Boolean)

ByVal (one word, not two) makes a copy of the variable (in this case,
SaveAsUI - the name is unimportant, BTW - it could just as easily be
called X or myDogHasFleas) and passes the copy to the called procedure,
instead of the original variable. This prevents the called procedure
from altering the original variable. ByVal is not the default behavior -
that would be ByRef, which just passes the original variable without
making a copy. This allows the called procedure to directly change the
variable. (That's a bit simplified, but what I left out would probably
just confuse you even more, I bet.)

>I see these in codes coming after Private Sub Workbook_BeforePrint

They're part of the declaration of the sub; they are parameters sent to
the procedure and can affect how the procedure operates. You see the
same sort of thing with almost all built-in keyword, such as MsgBox:
    MsgBox (Prompt, Buttons, Title, [etc])
With MsgBox, the parameters can affect what's displayed as the message,
what buttons are shown, etc.

Now, I hate to be the one to tell you this, but based on your questions,
you appear to be unfamiliar with some fundamental concepts of
programming, and this really isn't the place to start from scratch.
You're far better off coughing up some money for either a book or a
class. Microsoft Press (and likely others, but I haven't looked)
publishes books specifically about programming MS Office (I have
_Microsoft Office 97/Visual Basic Programmer's Guide_; cost me US$34.99
five years ago). Many (most?) colleges offer programming classes; see if
your local community college (or whatever) offers a class on programming
Visual Basic (but not QBasic or generic BASIC).

-- 
auric underscore underscore at hotmail dot com
*****
Custer's Last Photo-Op


Relevant Pages

  • Re: Bob P. and Roger G. --> IF(and(...IF(OR( vs. IF(Boolean
    ... They are about to switch to Excel finally. ... referring to the Excel courses offered in the colleges and programming ... he/she may not know Boolean which is not part of the curriculum. ... SUMPRODUCT and I am learning to use Boolean outside of SUMPRODUCT. ...
    (microsoft.public.excel.worksheet.functions)
  • Re: modifying array access syntax
    ... >> programming equivalent is far worse than paper and pencil notation. ... an argument which hardly holds for greek letters, ... > Note that mathematician start with a long list of definition: ... Same reason it makes sense in the codes I write. ...
    (comp.lang.lisp)
  • Re: A petition to J3 apropos FORTRANs future
    ... >> web programming, GUI development, and text analysis. ... >> may partially explain the small market share of Fortran. ... almost NO new code would be written in the language. ... time on the types of codes that scientists and engineers want and need to ...
    (comp.lang.fortran)
  • Re: Fortran vs C++ for scientific computing
    ... of our codes are far too complex. ... of F95 vs. C++ for scientific computing? ... The analogy I use for this sort of thing is one of regular old spoken languages: ... This issue comes up again and again in comparing programming ...
    (comp.lang.fortran)
  • Re: Why INFINITE loop in a thread occupy so much CPU time??
    ... A real killer comes with mixed language programming (a world in which I have ... lived for many years) and passing variables, boolean especially, from one ... I heard some time ago about a compiler which IIRC ...
    (microsoft.public.vc.mfc)