Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Prototyping and Visual Basic

7 views
Skip to first unread message

Winefred Washington

unread,
Oct 16, 1991, 12:00:16 PM10/16/91
to

Hi,

I am currently developing several large Windows apps using BCC++; however,
I am looking for a FAST method of prototyping a Windows app. Visual Basic
sounds kinda interesting; but I like to get a few VB users opinions.

1) How steep is the VB learning curve?

2) The last time I did anything in major Basic was 1979. Is its
dialect very different from Basics of that period?

3) Are there Windows functions/features which are difficult
to implement in VB?

4) Are there things you simply can't do in VB?

5) Can DLLs created with BC++ be accessed with VB?

Thanks in advance,
Winefred

Christopher Sacksteder

unread,
Oct 17, 1991, 9:43:21 AM10/17/91
to
In article <1991Oct16.1...@b11.ingr.com>, wine...@b11.ingr.com
(Winefred Washington) says:
>. . . Visual Basic

>sounds kinda interesting; but I like to get a few VB users opinions.

I think it would be great for prototyping, but I may not be qualified to
say since I've not done any Win apps with anything else. Perhaps QuickC
for Windows would be better for a C programmer.

> 1) How steep is the VB learning curve?

Hard to say; I found it initially quite steep, but flattening quickly;
the language is not large. A nice thing is that since it is an
interpreter, development is very quick -- you can do a lot of things by
trial & error instead of reading a lot of the manuals or help files. I
like the immediate feedback and interactive debugging. The "surprise"
factor is very small.

> 2) The last time I did anything in major Basic was 1979. Is its
> dialect very different from Basics of that period?

Same here; hadn't used Basic since 1981 when that was all there was for
an IBM PC. This one is VERY different (no line numbers, control
structures, real subroutines and functions, data structures, modules,
global data, user defined types etc.) File I/O and data types look
familiar. I still don't like Basic, but this one is ok.

> 3) Are there Windows functions/features which are difficult
> to implement in VB?

Maybe; see list below; perhaps other people have a more explicit list.
Note that there are a number of shareware and retail packages that
enhance VB's capabilities.

> 4) Are there things you simply can't do in VB?

Yes; see list below; perhaps I'm wrong about some things. (Tell me!)

> 5) Can DLLs created with BC++ be accessed with VB?

I believe so (anyone else?)

Below is a rather unorganized list of things I think are limitations or
restrictions. I'm gonna tidy it up some day. Despite this list, I
think it is a wonderful product, and I very much enjoy working in it.
I can't wait for next version.

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

Problems/Limitations

Opens with 4 separate windows; one or two more might be opened later.
You will want to minimize other applications such as the File Manager
and Program Manager which get in the way.

No right button support (?)

Can't change colors of buttons (?)

Hard to see all the properties of a control. Would be nice to have
some review screen or table. Would be nice to see all procedures
at once too.

Could be easier to duplicate properties among controls (e.g., setting
the font size for several labels is tedious.

There is a minor problem in changing colors of labels -- have to fill
in the box with blanks, but that doesn't always work.

With some window colors, you can't see a control's frame to move or
resize it; have to change the window color later.

Several errors in manuals
Guide: p 325, second from last line -- "idle"dvbpgapawhen none

Reference: SendKeys, p283-284, fails to mention that "(" and ")" are
also special characters that need to be enclosed in braces.

SendKeys Problems

The function is limited in what keys it can send to the application;
for example, shift-pageup results in a "9", which is shift of the
PageUp key on the number pad. I really needed the shift of the
other PageUp key.

Deleting Controls

When you delete a control, its event procedures are moved to the
general procedures part of the module. If those lines are deleted,
then you get an error message "Statement cannot precede Sub/Function
definition." There were no statements visible in the general
section.

Shell Problems

Shell used to start an application ("c:\comm\pc3270w\pcs3270.exe")
did not work, even though this is the property for the application
in the program manager and entering this on a RUN line works; the
path was not set and the application could not find files. Solution
was to put directory in the system path (before starting Windows).

Statements

There doesn't seem to be a way for program statements to span more
than one line; a line can be very long, but for ease of viewing, it
would be nice to have a statement continuation ability.

Renaming a Control

. . . is awkward; associated procedures are moved to the general
section, and have to be moved back to the new sections created for
the control.

MAKE.EXEC Box

Wish it would remember subdirectory the .EXE was put in last time it
was created.

Copying code and controls between projects is difficult.

Current Windows

It would be nice if there was a function to return a list of open
windows. A Visual Basic program for controlling another application
has to know window names ahead of time, and has to do error trapping
on AppActivate to see if the application is running or not (and do
Shell if it isn't running).

InputBox$ Problem

Used InputBox$ in one program and the results were totally bizarre;
an event procedure that should not have been called was. Switch to
using an additional form instead.

Needs Autosave feature

An autosave feature would be nice, particularly since the system
hangs for me almost every day (probably not VB's fault).

Lost controls

If you accidently slip a control under a frame, you have a real hard
time finding it again!

List boxes

Cannot make multiple selections.

Printing

. . . is primitive. No file names or indexes are given, although
both forms and/or code can be printed.

File System

No way to get file dates and times (?).


HINTS

Replacing items in a list box:

Given a list box, LIST1, and a selected item (I% = List1.ListIndex),
to replace the item you might do:

List1.RemoveItem I%
List1.AddItem <string$>, I%

But that causes the item to no longer be selected. It isn't clear
in the manuals or help, but you can do:

List1.Text(I%) = <string$>

and the item remains selected.


Efficient Development

-- to show a control's first event procedure, double-click on the
control

-- ctrl-up and ctrl-down can be used to quickly cycle through
procedures

-- ctrl-right and ctrl-left move the cursor by word

-- double-click on a word to mark the whole word

-- learn how to split the code window to see two procedures at once

-- use the keyboard to jump to the first letter of any list (controls,
procedures

Joe ROBISON

unread,
Oct 20, 1991, 8:52:40 PM10/20/91
to
|From: C...@psuvm.psu.edu (Christopher Sacksteder)

|
|> 5) Can DLLs created with BC++ be accessed with VB?
|
|I believe so (anyone else?)

Visual Basic doesn't care what created the DLL. As long as the routines
in the DLL use the Pascal calling convention (standard for Windows) and
don't require call-backs, VB can call them.

|Problems/Limitations
|
| Opens with 4 separate windows; one or two more might be opened later.
| You will want to minimize other applications such as the File Manager
| and Program Manager which get in the way.

Yes. It helps if you set the Options Minimize on Use command in the
Program Manager.

| No right button support (?)

The Visual Basic development environment does not assign any functions
to the right mouse button. However, your Visual Basic programs can
react to the right mouse button (and even the middle button on a three
button mouse) in any way you like.

| Can't change colors of buttons (?)

This is a Windows limitation. If you use standard Windows command
buttons in program written in C or C++ or TPW or Actor, you cannot
change the colors either. You can change the color of every button
in the system by setting some values in your WIN.INI, but that's
usually not what you want. There are command button custom controls
available that allow you to change their colors (and do other cool
non-standard things like put bitmaps on the buttons).

| Hard to see all the properties of a control. Would be nice to have
| some review screen or table. Would be nice to see all procedures
| at once too.

This is useful feedback; I'll make sure this gets included in our
database of ideas for future versions. (Really. This database
exists and we do use it when designing the next version(s).)

| Could be easier to duplicate properties among controls (e.g., setting
| the font size for several labels is tedious.

You can set the properties for one label and copy and paste it;
by default, VB copies all the properties so the CtrlName will be
the same as well -- this is why it asks you if you want to create
a control array. In the case of labels, I usually do create a
control array this way: there is rarely any code associate with my
label controls (unless I'm doing DDE with one of them) so having
them all in a control array means there is just one entry in the
object listbox instead of dozens.

| There is a minor problem in changing colors of labels -- have to fill
| in the box with blanks, but that doesn't always work.

Can you explain this a little more? What exactly is the problem?

| With some window colors, you can't see a control's frame to move or
| resize it; have to change the window color later.

Hmmm, we'll have to look at this.

| Several errors in manuals
| Guide: p 325, second from last line -- "idle"dvbpgapawhen none

This will be fixed in later reprints of the manuals (believe it or not,
that's a little bit of Postscript that lost its way...)

| Reference: SendKeys, p283-284, fails to mention that "(" and ")" are
| also special characters that need to be enclosed in braces.

I think this is going to be fixed in later reprints as well.

| SendKeys Problems
| The function is limited in what keys it can send to the application;
| for example, shift-pageup results in a "9", which is shift of the
| PageUp key on the number pad. I really needed the shift of the
| other PageUp key.

Interesting. I can send a Shift+PGUP to MS Write
(using SendKeys "+{PGUP}" like you would expect) and it does what
Shift+PgUp is supposed to do (selects the previous page of text).
Perhaps the application you are sending keys to is looking for
actual keycodes rather than VK keys?

| Deleting Controls
|
| When you delete a control, its event procedures are moved to the
| general procedures part of the module. If those lines are deleted,
| then you get an error message "Statement cannot precede Sub/Function
| definition." There were no statements visible in the general
| section.

Hmmm. Make sure you are selecting all the lines in the Sub, including
any blank lines that follow the Sub.

| Shell Problems
|
| Shell used to start an application ("c:\comm\pc3270w\pcs3270.exe")
| did not work, even though this is the property for the application
| in the program manager and entering this on a RUN line works; the
| path was not set and the application could not find files. Solution
| was to put directory in the system path (before starting Windows).

If I understand you, you are expecting Shell to switch the current
directory to this directory and then run this EXE. This does work in
the Program Manager but doesn't work in VB: Shell does not change the
current directory; you have to do that explicitly yourself. You can
get the effect you want with:
ChDrive "c"
ChDir "\comm\pc3270w"
t% = Shell("pcs3270.exe")

| Statements
|
| There doesn't seem to be a way for program statements to span more
| than one line; a line can be very long, but for ease of viewing, it
| would be nice to have a statement continuation ability.

Again, this is good feedback. Our threaded p-code compiler pretty much
relies on statements not spanning lines, so this isn't something that
is trivial to implement. If we get a lot of feedback indicating this
is a desirable feature, we'll certainly look at it. Maybe when we port
to NT? :)

| Renaming a Control
|
| . . . is awkward; associated procedures are moved to the general
| section, and have to be moved back to the new sections created for
| the control.

Yeah, this bugs me too. Would it be enough to just rename the procedures
and leave references to OldCtrl.<whatever> in your code (they will be
easy for you to find since they will cause errors when you go to run your
program)? Of course, the real answer is always know for sure what you're
going to call your controls before you write any code for them! ;)

| MAKE.EXEC Box
|
| Wish it would remember subdirectory the .EXE was put in last time it
| was created.

Good idea.

| Copying code and controls between projects is difficult.

Allowing multiple projects open at the same time makes things pretty
complicated if you do something like try to run...You can of course
keep modules around that are used in more than one project and share
code that way.

| Current Windows
|
| It would be nice if there was a function to return a list of open
| windows. A Visual Basic program for controlling another application
| has to know window names ahead of time, and has to do error trapping
| on AppActivate to see if the application is running or not (and do
| Shell if it isn't running).

You can call functions in the Windows API (GetWindow, etc) to do this;
you can also use the Windows GetModuleHandle function to see if an app
is running, or try to do DDE with it if it supports DDE. Perhaps this
is something we should build into future versions of Visual Basic.

| InputBox$ Problem
|
| Used InputBox$ in one program and the results were totally bizarre;
| an event procedure that should not have been called was. Switch to
| using an additional form instead.

Strange. We used InputBox$ in many of the example programs in the Help
and all of these were tested. We would've noticed if there was a problem.
If you can reproduce this we'd like to get the details.

| Needs Autosave feature
|
| An autosave feature would be nice, particularly since the system
| hangs for me almost every day (probably not VB's fault).

Another good idea. (And I'm sure the hangs were not VB's fault :)
Also, Windows 3.1 should make hangs less common.

| Lost controls
|
| If you accidently slip a control under a frame, you have a real hard
| time finding it again!

Try tabbing through all the controls.

| List boxes
|
| Cannot make multiple selections.

Maybe in a future version...there are custom list box controls available
that do multiple/extended selection, multiple columns, etc.

| Printing
|
| . . . is primitive. No file names or indexes are given, although
| both forms and/or code can be printed.

We are trying to figure out the best way print VB apps. If you have an
idea for a specific layout that you think would be ideal, please let me
know.

| File System
|
| No way to get file dates and times (?).

Not in this version. Again, there are DLLs and custom controls that
provide this functionality. (I know, this is getting kind of repetitive
but all those companies that provide this stuff love us :)

|HINTS

[handy hints deleted]

Some more hints:
Select a call to a procedure (double click on it) and press
Shift+F2 to jump to that procedure.

Ctrl+Y cuts the current line to the clipboard
Ctrl+N opens a blank line before the current line

You can select several lines and press Tab to indent all of them
Shift+Tab will unindent them.

You can get help on any keyword by placing the carret anywhere in
the word and pressing F1 but in the Immediate window you have to
select the entire keyword before pressing F1


Glad you like Visual Basic. Thanks for all the feedback.

Joe Robison

...posted with experimental news browser software...
...please ignore glitches...
I am not a Microsoft spokeshuman: usual disclaimers apply

Sten Sunnergren

unread,
Oct 21, 1991, 5:39:44 AM10/21/91
to
In article <t4#d!#r...@microsoft.UUCP>, jo...@microsoft.UUCP (Joe ROBISON) writes:
>|From: C...@psuvm.psu.edu (Christopher Sacksteder)

>| MAKE.EXEC Box
>|
>| Wish it would remember subdirectory the .EXE was put in last time it
>| was created.
>
>Good idea.
You can make VB remember the subdirectory til next time, by just saving
the project afeter making the EXE.

/Sten

P.S. Thanks Joe, for answering all the questions. We VB users
appreciate that very much. Later I will post some more
items for your database, I just have to translate them
from swedish first.

0 new messages