From ankh.iia.org!uunet!MathWorks.Com!yeshua.marcam.com!charnel.ecst.csuchico.edu!xmission!u.cc.utah.edu!park.uvsc.edu!knosack Tue Aug 23 23:10:52 1994
I found the following VERY useful, to the point that I
don't even use the manuals anymore:
6. The Visual Guide to Visual Basic for Windows, by
Richard Mansfield, published by Ventura Press. This is a
encyclopedia of the language itself. It supposes that you
DO know how to program so basically (if you pardon the
pun) it's a guide to VB's slang. I use this for referencing
the grammar when i get a bug.
---From: idavidson@csu.edu.au (Ian Davidson)
7. Visual Basic How-To, Robert Arnson, Daniel Rosen,
Mitch Waite & Jonathon Zuck: The Waite Group, 1992.
ISBN 1-878739-09-3. Includes disk. Many practical
examples & some sample custom controls.Introduces &
expands on the use of API's. An excellent book suitable
for Beginners thru Advanced - one of my most-often-used
references.
8. Learn Programming and Visual Basic with John
Socha, John Socha: Sybex, 1992. ISBN 0-7821-1057-6.
Includes disk. A useful introduction for absolute beginner
programmers thru intermediate.
-- From Gary Cornell:
There's a new version of my book - it's been enlarged and
updated. It's now called the Visual Basic 3 For Windows
Handbook.
Author : Cornell, Gary
Title : Visual Basic 3 For Windows Handbook
ISBN : 0078819318 Dewey # : 005.10
Publisher: Osborne McGraw Hill
Date Pub : 01/93
--from Wallace Wang: 72662,1711 (Compuserve)
Here's the information you requested. Thanks for including
my book in your listing:
Publisher name: IDG Books Publisher
address: 155 Bovet Road, Suite 310
San Mateo, CA 94402
Phone number: (415) 312-0650
Fax number: (415) 358-1260
Book name: Visual Basic 3 For Dummies
Author name: Wallace Wang
When released: March 1994
50-word description: This book takes readers,
step-by-step, to understanding, learning, and writing
Visual Basic programs. Explains how to use the most
common features of Visual Basic for creating user
interfaces and writing BASIC code. Includes a
friendly dose of humor and easy to read explanations,
this book also includes suggestions for finding
additional information about Visual Basic. Intended
audience:
Beginners Price: $19.95
Disk of examples: No.
---From EDITOR:
The following books were those I found using a keyword
search of 'VISUAL' at the internet site BOOKS.COM. This
site can be used to purchase books via credit card or you
can use their database of books to find information as I
have done.
Author : Nelson, Ross
Title : The Microsoft VB for Windows Primer
ISBN : 1556154771 Dewey # : 005.10
Publisher: Microsoft Pr Date Pub : 11/92
Author : Orvis, William
Title : Do It Yourself Visual Basic for Windows
ISBN : 0672302594 Dewey # : 005.10
Publisher: Sams Date Pub : 11/92
Author : Craig, John Clark
Title : Microsoft VB Workshop/Book and Disk
ISBN : 1556153864 Dewey # : 5.26
Publisher: Microsoft Pr Date Pub : 09/91
Author : Murray, William H./Pappas, Chris H.
Title : Using VB : Writing Windows Apps
ISBN : 0201581450 Dewey # : 5.43
Publisher: Addison Wesley Pub. Co.
Date Pub : 01/92
========================
BOOK LIST for VBDOS
========================
Author : Hergert, Douglas A.
Title : Visual Basic Programming With DOS
Applications
/ Book and Disk
ISBN : 0553370995 Dewey # : 005.00
Publisher: Bantam Doubleday Dell Pub
Date Pub : 07/92
From ankh.iia.org!uunet!MathWorks.Com!yeshua.marcam.com!charnel.ecst.csuchico.edu!xmission!u.cc.utah.edu!park.uvsc.edu!knosack Tue Aug 23 23:11:02 1994
There is an article in the Microsoft Knowledge Base that points to
each of these files and provides more detailed information about
the update. To find these articles, query the Microsoft Knowledge
Base using the file name and the word "update3.00".
Note the NEW SETUPKIT update!
[Thanks to Marks Harrop <harrop@werple.apana.org.au>]
Please inform the FAQ maintainer about newer versions.
I. VISUAL BASIC FOR APPLICATIONS (VBA)
1. Any tips for VB/Win 3 programmers moving to VBA?
You are in for some surprises. VBA is more unlike VB 3 than most
people thought. Especially the development environment is very
different, and the language puts more emphasis on objects. The
latter is a trend you can get used to for VB also.
For Excel 5 VBA, be aware that the environment is based on the
"workbook" idea Microsoft stole from Borland. Your controls will be
placed in one sheet, and the code will be in another.
Doubleclicking on the control to open the code window doesn't help.
You have to use the "Tools|Assign Macro" menu option.
Also, be aware that the list of events is nowhere close to what VB3
supports! No GotFocus, no MouseMove, no nothing. You'll be very
confused if you try to look for "events" in the VBA docs!
2. Does VBA support VBXs?
No. If Microsoft have its way, VBX is a dead end. There will never
be 32-bit VBXs, but OCXs using OLE 2. VBA is more a subset of VB 4
than VB 3, but it does not fully support OCX yet. It will, though.
3. How do I access properties on my dialog boxes in VBA?
As noted above, VBA is a cultural chock for VB programmers. If you
create a textbox in VBA, call it txName and try to
cMyVar=txName.Text
the impolite interpreter will give you a "variable not defined"
error.
The magic is objects. You have to
Dim txName as Object
Set txName = DialogSheets("NameDialog".EditBoxes("txName"))
And then you can access your properties like you used to in good
ol' VB 3. (Anyone volunteer to beat senseless the guy who thought
out this?)
4. How do I use database routines from Excel VBA?
The documentation is somewhere between sparse and inexistant on
this topic. Any info on VBA and SQL would be much appreciated.
Here Microsoft breaks the tradition and you *can't* use database
objects, at least not the way you do in VB. Also, forget dynasets.
I know nothing about databases in VBA. I just bring on the
following tips from various magazines:
Both SQLOpen and QueryGetData require a 'connection string'. That's
about what the doc's say about the parameter. What is it? The doc
is also tragically void of useful examples. Someone dug up the
following example:
"DSN=My data file;DBQ=c:\access\data.mdb;FIL=RedISAM;"
which is about as understandable as it looks. If you use an empty
string, you get a dialog which also can give you the string into a
spreadsheet cell.
Also, search for SQLREQUEST in the *main* help file for Excel 5
(not the VBA help!) for these examples of connection_string's:
dBASE DSN=NWind;PWD=test
SQL Server DSN=MyServer;UID=dbayer;PWE=123;Database=Pubs
ORACLE DNS=My Oracle Data Source;DBQ=MYSER VER;
|UID=JohnS;PWD=Sesame
There's a KnowledgeBase on Excel 5 on ftp.microsoft.com. Last time
I looked, it was void of database stuff. Still, it may be a good
idea to download it as the situation may have changed now.
*** END OF VB/WIN FAQ DOCUMENT ***
From ankh.iia.org!uunet!MathWorks.Com!yeshua.marcam.com!charnel.ecst.csuchico.edu!xmission!u.cc.utah.edu!park.uvsc.edu!knosack Tue Aug 23 23:11:09 1994
1. How do I use (create) global variables in VBDOS?
1.1. VBDOS provides the user with two types of global variables.
These are both used in declarations of variables.
To share variables between all subs and functions in a specific
module, use the SHARED keyword. This makes that specific
variable global _in that module_. For example:
DIM SHARED CancelFlag AS INTEGER
would make the variable CancelFlag a global variable in that
module.
To share global variables between separate modules, use the
COMMON keyword. For example:
COMMON SHARED CancelFlag AS INTEGER
would make the variable global between all modules that this
common statement appears in, and since we are using the
SHARED keyword also, this will also be shared in all the subs
and functions in the modules which this declare statement
appears. All COMMON statements must be matched between
modules which the variables should be global in. For example,
if you have one set of 10 COMMON statements in one module,
and a different set of 10 COMMON statements in another
module in the same project, you will get a 'Type Mismatch
Error'. Make all COMMON blocks identical in all the modules
in a specific project. (See Misc. Programming Tips Below).
2. Does VBDOS make standalone .exe files?
2.1. VBDOS can compile programs in two different ways (user
option). It can compile programs to use a RUNTIME file (like
a DLL) or can be compiled as a standalone .exe file.
3. What is the current version of the VBDOS compiler?
3.1. VBDOS is currently at version 1.0
4. How do I not make a text box beep when I hit the enter key?
4.1. Put "something else" in your _KeyPress event, depending on
what you really want. This code example makes *nothing*
happen, for an extended period of time:
Sub Text1_KeyPress (KeyAscii As Integer)
If KeyAscii = 13 Then '13 is Key_Return
KeyAscii = 0 '0 (zero) is nothing
End If
End Sub
This might not be a very nice thing to do, since your users
usually have some intention when they press Enter. Usually
they will want to jump to the next control, like the Tab key
does. You will then change the line KeyAscii=0 to KeyAscii=9
(Key_Tab) in the example above.
BTW, you'll also find this in the Microsoft VB
KnowledgeBase. They add that you should set the MultiLine
property to False. Of course.
5. How does Visual Basic handle shelled tasks? How do I find out
when they are finished.
5.1. In VBDOS, all shelled tasks are completed before control
returns to the program. No tasks are done while the DOS
command is being executed.
6. How do I break lines of long text into multiple lines of text in the
msgbox?
6.1. Use the append a chr$(13) to the end of the string to break
lines into multiple lines. EG:
msg$ = "This is line 1" + chr$(13)
msg$ = msg$ + "This is line 2"
MSGBOX msg$
7. What's the difference between MODAL and MODELESS forms?
7.1. Modal forms are forms which require user input before any
other actions can be taken place. In other words, a modal form
has exclusive focus until it is dismissed. When showing a
modal form, the program pauses at the SHOW command until
the modal form is either hidden or unloaded. The internal
MSGBOX and INPUTBOX$ forms are examples of modal
forms. To show a form modally, use the syntax:
MyForm.SHOW 1
7.2. Modeless forms are those which are shown but do not require
immediate user input. Most child forms (in a MDI application)
are typically modeless. To show a form modeless, use the
syntax: MyForm.SHOW
8. When/Why should I use Option Explicit?
8.1. Opinions vary greatly on this subject. The main reason to use
the OPTION EXPLICIT statement at the top of all modules is
to minimize the amount of bugs introduced into your code by
misspelling a variable name. Most variants of BASIC
(including VB) have the capability to create variables 'on the
fly' (without any declarations). This capability can be a double
edged sword.
At the minimum, it is suggested to use the DEFINT A-Z
statement in leu of OPTION EXPLICIT. This statement will
cause any variables which are created on the fly to be created
as integers as opposed to single precisions. (Integers take up
less memory).
The OPTION EXPLICIT statement causes VB to 'disable' it's
ability to create variables on the fly. Thus, all variables must be
declared using a DIM or REDIM statement. All variables not
declared will cause an error when the OPTION EXPLICIT
statement is used. This will eliminate any bugs when a variable
is misspelled.
9. Why doesn't PRINT or CLS from a frm module work?
9.1. To print information to the screen bypassing the desktop, the
commands must be issued from a .BAS module. All
PRINT/CLS output from a form module is directed to the nul:
device.
10. How do I invoke FKey traps which won't be triggered by other keys
which share the same KeyCode?
10.1. To trap the only FKeys in events you need to use a
combination of the KeyDown, KeyPress, and KeyUp
events.
The basic concept for this is that _all_ keys trap the UP &
DOWN events, while only 'printable' characters trigger the
KeyPress event. Thus, when a character key is pressed, it will
trigger the KeyDown, the KeyPress, then the KeyUp events (in
that order). While a FKey (or arrow, or tab, etc...) will trigger
the KeyDown, then the KeyUp events (in that order).
The following code uses a textbox tag property to decide
whether a printable character is pressed or not.
SUB Text1_KeyDown()
Text1.tag = "key"
END SUB
SUB Text1_KeyPress()
Text1.tag = ""
END SUB
SUB Text1_KeyUp()
IF Text1.tag = "key" then
'--PUT F-KEY HANDLER HERE----
ELSE
'--PUT OTHER KEY HANDLERS HERE----
END IF
END SUB
11. How do I boost memory available to VBDOS.EXE (the IDE)?
11.1. Try to have as much EMM available as possible.
VBDOS.EXE allocates subroutines & functions which are
< 16K into EMM.
11.2. To make more conventional mem availble, use the /S:n
switch. This will make VBDOS.EXE use a specific
amount of conventional memory. A good compromise
between speed & memory is /S:340. The lower the n
value, the slower the environment runs.
11.3. Running out of DGROUP usually causes most 'out of
memory' errors. Possible causes are:
11.3.1.Too many subs & functions exist. Each one takes up
46 bytes of DGROUP.
11.3.2. Large static arrays. All static arrays are stored in
DGROUP. If a DIM statement is for a COMMON
SHARED statement, the array becomes static. Make
the COMMON SHARED statement appear before
the DIM statement to make the array Dynamic &
therefore will not be stored in DGROUP.
11.3.3. Variable Overhead. Each var has a 4 byte overhead
for _each_ module. For multiple modules projects
which use lots of Global (COMMON) statements,
this overhead is repeated for _each_ module.
11.4. Possible causes for running out conventional memory:
11.4.1. Not enough EMM.
11.4.2. Subs or functions which exceed 16K.
11.4.3. Large arrays. Non-variable length string arrays can
be stored in EMM using the /ea switch.
12. My program runs in the IDE, but won't run when compiled??
12.1. Arrays are dynamic by default in the IDE, but when they
are compiled, they are static by default. Therefore, they
are stored in DGROUP instead of the far heap. Use
'$DYNAMIC to make all arrays dynamic or use REDIM
instead of DIM.
12.2. Program generates a "program memory overflow" during
compile. You need to break a single module into multiple
ones.
13. MISC. Programming TIPS:
13.1. When useing the form designed, to continuously draw
controls of a specific type, hold down the control key
when clicking on the appropriate control from the tool-
box.
13.2. Use the INCLUDE statement to manage large numbers of
COMMON SHARED statements, user defined data types,
or external function DECLARES. To use an include file,
simply put all the VBDOS statements that will be shared
into a single file. Save the file as something appropriate.
(Typical naming convention is to use an extension of .BI
for basic include files). Then simply insert the line:
'INCLUDE: 'foobar.bi'
into either your .BAS module, or the module level code
in a form.
From ankh.iia.org!uunet!MathWorks.Com!yeshua.marcam.com!charnel.ecst.csuchico.edu!xmission!u.cc.utah.edu!park.uvsc.edu!knosack Tue Aug 23 23:11:14 1994
From ankh.iia.org!uunet!MathWorks.Com!yeshua.marcam.com!charnel.ecst.csuchico.edu!xmission!u.cc.utah.edu!park.uvsc.edu!knosack Tue Aug 23 23:11:20 1994