CanDo: An Interactive Authoring Tool, Part 1 -- Comparison With Visual Basic

by Randy Finch

After having used Microsoft Visual Basic (VB) in the Windows environment on my PC-compatible for a while, I decided that I would like to have a similar tool for my Amiga. After studying reviews in several magazines, I decided that CanDo was probably the closest thing to VB available for the Amiga. I called Inovatronics, the producers of CanDo, and asked a representative how CanDo compared to Visual Basic. After talking for awhile, I realized that he was not very familiar with VB. However, after asking some rather probing questions, I decided that CanDo was what I was looking for and therefore ordered a copy. I was well pleased with certain features of CanDo and disappointed with others. Since that original purchase, I have upgraded to version 2.0 of both CanDo and VB. I thought it would be worthwhile comparing these two products to see how one of the top visual programming tools for the Amiga stacks up against one of the top visual programming tools for the PC. That is what I will do in part 1 of this article. In part 2, I will go into detail about some of the most important features of CanDo for productivity software development. Part 3 will present a step-by-step tutorial on creating a custom object using a generic CanDo object along with graphics and programming. Nuff said, on with part 1.

First off, let me mention that CanDo 2.0 and the standard edition of VB 2.0 have the same list price ($199 as of this writing). There is a professional edition of VB available for a higher price ($495 list). Also, there is a version of VB available for the DOS environment which I do not own. Therefore, all of my comments about VB apply specifically to the Windows version.

CanDo is called an interactive software authoring tool while VB is called a visual programming system. For all practical purposes, they are the same except that CanDo has its own unique programming language while VB uses a modern structured version of the Basic programming language that we all love and revere (?!?). Therefore, if you are familiar with Basic programming, you would probably be able to come up to speed with VB faster than with CanDo. However, as we shall soon see, there is much more to interactive visual software authoring and programming language tools than keywords and variables. In both CanDo and VB, the user interface is designed visually. No coding by the programmer is needed. This is the great appeal of visual programming: you only have to code the application specific parts, not the generic interface parts common to most programs.

What VB Can Do, CanDo Can Do (sometimes)

Upon loading VB and CanDo, you will find several similarities and several differences. VB has a menu bar and toolbar window, a toolbox window, a project window, a properties window, and a blank form (Figure 1). The menu bar contains all the pull down menus that let you navigate through the program while the toolbar contains buttons that let you more quickly execute some of the most frequently used menu functions. The toolbox window contains buttons for each of the interface controls that are available to your application. VB Professional contains some custom controls not available in the standard edition. The project window provides a list of the forms, code modules, and custom controls used by your application. The properties window provides a list of properties of the currently selected control or form. The blank form can be used as the initial form in your application. Pull down menus, interface controls, and a toolbar can be added to the form.

CanDo starts up with a blank card. What is the difference between a blank form in VB and a blank card in CanDo? Well, to make a short story even shorter: nothing. Both are windows that you can use to build an interface for your application. On a separate screen overlaying the bottom of the blank card, the menu bar, toolbar, and toolbox are displayed in a combined way. This is called the Main Control Panel (Figure 2). Everything you need to navigate the CanDo environment is on this panel.

VB supports a Windows feature called Multiple Document Interface (MDI). An MDI form acts as a container for child forms. This allows your application to handle several projects at once and share code in the process. This can be simulated with CanDo, but it is not as easy.

To an Amigan, the method used to display the control panel (one screen over another) is not unusual. However, it points up one of the great advantages that the Amiga has over Windows: multiple resolution screens on the display simultaneously. VB offers no such interface because Windows offers no such interface. Within the Windows environment, you must select a graphics resolution supported by your graphics display card. Once set, all programs run in this resolution. Also, all programs run on one screen. Even though program windows can be made full screen or minimized to an icon, the display can sometimes become quite cumbersome. In contrast, the Amiga can have multiple screens each containing multiple windows. This helps the display stay more organized. The problem with not having multiple resolution screens available to the programmer is that you have to design your interface for the lowest common denominator which is currently VGA (640x480, 16 colors). If you design your interface in SuperVGA (800x600 or 1024x768, 256 or more colors), it may not look right on a computer that only has VGA. Also, you may want your application to have multiple screens at different resolutions. This is easy on the Amiga, but hard or impossible on the PC.

Controls or Objects - Take Your Pick

VB and CanDo have many different interface objects (called controls in VB) that can be added to an application. Some objects are common to both; others are only available to one or the other. Some of the common objects are pull down menus, command buttons, text entry boxes, and list boxes. Some objects are common to both products but are more easily implemented in one or the other product. For example, check boxes and radio buttons are much easier to handle in VB. However, incorporating animation is much easier in CanDo.

VB includes a combo box control which is absent in CanDo. This control is essentially a text entry box and a list box combined together. Therefore, it can be simulated in CanDo but it takes a bit more work. Also, VB includes some controls that allow you to design a custom file requester. This is more difficult with CanDo; however, CanDo does have a pre-built file requester that can be included in your application. A pre-built file and font requester is available in VB Professional as a custom control.

One particularly nice feature of VB not found in CanDo is the frame control. This control acts as a container for other controls. You can group several controls together in a frame and when the frame is moved, all the enclosed controls go with it. This makes it easy to lay out functional areas of your application interface and then reorganize it later. The appearance of a frame can be simulated in CanDo but the functionality is not there.

VB has a grid control for spreadsheet-like input that is missing from CanDo. Also, your VB application can be an OLE (object-linking and embedding) client and can also exchange data with other applications using DDE (dynamic data exchange). There is no equivalent to OLE on the Amiga that I am aware of. Hotlinks and ARexx are the closest things to DDE on the Amiga. CanDo supports ARexx but not Hotlinks.

CanDo gives you more control over the appearance of objects than does VB. You can easily give your interface a 3-D appearance. VB Professional comes with some 3-D custom controls but they require you to use a set gray color background for them to look right. With CanDo you can create 3-D objects on any color background.

When it comes to drawing shapes such as lines, circles, rectangles, etc. on the screen, VB wins out. You can draw shapes easily and modify their sizes quickly. CanDo will let you draw on the screen, but it writes code for you instead of directly incorporating the shape into the window. When you want to modify the shape, you have to either edit the code or redraw the shape, forcing CanDo to write new code. The old code must then be erased.

VB is much better at handling the resizing and moving of controls than CanDo. In VB, you move a control by clicking on the control and dragging the mouse. Also, when the control is clicked on, an outline box with resizing handles is drawn around the control. By clicking on the resizing handles and dragging the mouse, the control can be resized in any direction quickly and easily. In CanDo, you must click on the object to bring up the object's edit requester. A few more clicks will get the object moved or resized. This is not very efficient.

VB Professional comes with some tools and documentation that help you to create your own custom controls using a C/C++ compiler. Additional controls (objects) can be added to CanDo through the XTras button; however, there is no information with the software about how to do this. The ability to add your own custom controls may not be of interest to the casual programmer, but it is still important. There are tons of custom control packages for VB available from third party companies. I know of no such packages available for CanDo.

Code One

Both VB and CanDo use the event driven programming paradigm. In short, this means that the user interface is made up of controls or objects (i.e. menus, buttons, text entry boxes, list boxes, etc.). As the user interacts with the interface using a mouse, keyboard, joystick, or some other input device, certain object events occur. For instance, if the user clicks on a button, that button will receive a click event. Therefore, most of the code you write for your application is telling the system what to do when an event occurs. VB takes an object-oriented approach to its controls while CanDo takes a control-oriented approach to its objects. What does that mean? Let me explain.

In VB, controls have properties, methods, and events. A property is some attribute of the control such as width, font, name, etc. Some properties can be set at design and run time. Others can only be set at one or the other. For instance, if you wanted to set the width of a button control with a name of cmdOK to 300 at run time, the following statement can be used:

	cmdOK.Width = 300

The current width could be obtained as follows:

	CurrentWidth = cmdOK.Width

All properties would be set or read in a similar way:

	Set:ControlName.AnyValidProperty = AppropriateValue
	Read:CurrentProperty = ControlName.AnyValidProperty

A method provides a functional operation on an object. Anyone familiar with C++ will have no problem with this concept. Suppose I have a list box with a name of lstNames and I want to add another item, in this case a name, to the list. I would invoke the AddItem method of the list box as follows:

	lstNames.AddItem "Angus Macgyver"

All methods would be invoked in a similar way:

	ControlName.AnyValidMethod  AppropriateValue

When you double-click on a control in your VB application interface while in design mode, a code window appears. A drop-down list shows all of the events available to the chosen control. When you select an event in the list, VB creates a subroutine shell as follows:

	Sub ControlName_ChosenEvent( )

	End Sub

It is up to the programmer to fill in the subroutine to make the program functional.

CanDo takes a different approach. Objects have properties just as VB controls do; however, they are not obtained or set in the same manner. To obtain a property, you sometimes use a command and other times a system variable. For instance, if you want to obtain the current window's size limits, you would use a command as follows:

	GetWindowLimits   MinXSize, MinYSize, MaxXSize, MaxYSize

However, if you want to obtain the current window's title, you would use a system variable:

	CurrentTitle = WindowTitle

Notice that in both of these examples, no reference is made to which window you want the information for. The information can only be obtained for the current window. If you want the information for another window, you must make it the current window. To make things more confusing, the window title is set with a command rather than assigning a value to the system variable WindowTitle:

	SetWindowTitle  "I Don't Like Titles"

In a similar fashion, if you want to perform an operation on an object, a command is used rather than a method. To disable an object with a name of MyObject, the following statement is used:

	DisableObject  MyObject

When you click on an object in design mode to bring up its edit requester, there will be a series of command buttons, one for each of the events that can be handled by the object. When you click on one of these event names, an editor appears with a blank page. You can fill in any code you want to execute when the event occurs. This is very similar to VB except for two things: (1) CanDo has less events available to its objects and (2) CanDo does not create a subroutine shell. The latter difference makes it slightly more difficult to call one event routine from another event routine.

As you can see, there are quite a few differences in the way VB and CanDo handle objects. I prefer the method used by VB; however, I am sure others will prefer the method of CanDo.

Varying Variables

VB and CanDo are quite comparable when it comes to standard variable types and operators. The usual complement is available in both products. VB has a currency type variable that can be very useful for someone writing financial software. It also has a variant data type that can mutant from one variable type to another. VB also allows user defined variables that look a lot like C structures.

CanDo has features that makes it far superior to VB when it comes to handling variables. These features are the dynamic sparse arrays and user defined record variables. Arrays are dynamic because they are created as needed and sparse because they are not dimensioned and do not necessarily have consecutive indices. Record variables let you create highly complex user defined variables without ever having to predefine the structure of the variable. This works somewhat like stems do in ARexx. Thus, you can have a variable that looks like the following:

	MyData.Account[6].Name

without ever defining the inherent structure of the variable. Also, if Account[1] through Account[5] have not been referenced yet, no space will be taken up for them. This is due to arrays being sparse. These user defined variables are exploited in a very interesting way to allow for easy data entry to your application. Also, highly complex user variables can be saved to and retrieved from disk with one command. I will not discuss these features anymore at this time because I will be covering them in great detail in the second part of this article.

Documenting Documents

CanDo allows you to create documents that can be edited and displayed. There are many commands available for manipulating documents. No equivalent feature is available for VB. I will be discussing this in detail in the second part of this article also.

A Picture is Worth a Thousand Lines of Code

VB allows you to add pictures to your application just as CanDo does. Of course, the products support different graphics file formats. VB supports bitmaps, icons, and metafiles. CanDo supports IFF pictures and brushes.

When it comes to stringing pictures together to make an animation, CanDo is the clear winner. VB allows you to sequence several picture files together to create an animation, but the availability of the ANIM file format on the Amiga allows CanDo to excel in this area. (Note: CanDo actually uses BrushAnims rather than Anims. A conversion utility is included in the package.) Commands are available for loading, moving, and removing BrushAnims. Also, individual scripts can be executed as each frame is displayed. This is a very powerful feature for synchronizing events.

Sound Off

CanDo is definitely the leader in the area of sound because VB does not support sound except for being able to beep the speaker with the BEEP command. CanDo allows you to add 8SVX sound files to your application. Commands are available for loading and playing sound files as well as setting the channel and volume. A script can be executed when a sound begins and another when it ends.

Help!

VB comes with extensive on-line context sensitive help. It is essentially like having the manuals on-line and available at the touch of a button. CanDo has an on-line help system, but it is not nearly as extensive as VB's and it is only partially context sensitive.

VB Professional comes with a help compiler. This allows you to create some rather complex context sensitive help for your own application. However, creating the files that the help compiler needs is not for the light-hearted. You must use a word processor that can write files in the Rich Text Format (RTF). Some rather complex codes are needed. The task is easier if you own Microsoft Word for Windows and custom templates. Even so, the planning and organization that is required for good context sensitive help can be overwhelming to the casual programmer.

CanDo offers no integral way of creating a help system for your application; however, you can design your own. You will have to determine what your file format will look like and how you will access it and display it on the screen. If anyone has developed a way of easily doing this, I would like to hear from you.

Compiling

CanDo has the edge when it comes to creating an executable file for distribution. You can create a shorter executable file that requires the shared library cando.library. This shared library can only be used by people who own CanDo. Alternately, you can create a significantly larger (about 130 KB) stand-alone executable file that requires no other files except, of course, your support files like animations, graphics, sounds, etc. When distributing your program the latter way, no one can really tell how you created it. It could just as easily have been written in C.

VB does not allow you to create a stand-alone executable file. The freely distributable dynamic link library VBRUN200.DLL is always needed. I have heard some professional programmers say that this destroys the effectiveness of the language because, since the DLL file has to be distributed with your program, your users will know the program was created in Visual Basic. Given the stigma Basic has of not being a professional level language, this can be a problem.

Summing Up

As is typical when comparing similar products, each one needs some of the features of the other to make it a super product. VB is geared towards creating productivity software and therefore lacks the animation and sound capabilities that are needed for game and multimedia applications. Also, to be even more valuable as a productivity software development tool, it desperately needs the flexibility of the user defined record variables and dynamic sparse arrays that are included with CanDo.

CanDo is geared towards just about any kind of application. It excels at database development because of the flexible user variables. The sound and animation capabilities help it excel at multimedia applications and games that don't need the speed of assembly language. However, to ever be used for the development of higher end productivity applications, it needs to have a way for third party companies to add custom objects and a standard way to add context sensitive help.

There you have it. As I continue to program with VB and CanDo, I will be anxiously awaiting both Visual Basic 3.0 with CanDo extensions and CanDo 3.0 with Visual Basic extensions. Well, I can hope, can't I?

(Note: Just before submitting this article for publication, I received notice that VB 3.0 was about to be released. As I feared, it does not have any of the CanDo features I wanted. However, it now has a powerful database engine from the Microsoft Access product, hierarchical lists, and more. Alright, Inovatronics, it's your turn. Let's see a powerful new CanDo 3.0 that'll blow our socks off.)


Back to list of articles
Back to Randy Finch's Home Page
Last modified on April 1, 1996
Randy Finch at webmaster@rcfinch.com