Post by Justin GroshanThank you for your answers to my question. It's obvious that I do not
understand visual basis. I have attempted to find the answer to my question
without success. I probably don't know what to look for. I did find
debug.print in a book on VBA and I attempted it in vb5 with no success. I
will try it again. For vb6 and later editions I was able to find
write.console, however I have not tried it in vb5. I found a site in
Microsoft to download free versions of Visual Basic. I have quick basic and
I am operating it in virtual xp on my windows 7 64 bit computer. My
concern is that ultimately I will have to load windows 8. I understand that
dos programs will not run on windows 8. I have basic programs on my ipad. I
would like to be able to use vba. Just before writing this post I found in
a book that I just bought to learn vb5 the code to write z = x+y, define z
as a string and display it in a text box. This was purely by accident, I
looked under the section on code and found what I just described. There was
no reference in the index.
You seem to have a very mismatched understanding of the languages and
code and confusing everything.
A few basics (no pun intended):
* Basic is a relatively simple language and syntax used by multiple
different languages.
* QBasic is a DOS interpreter (and sometimes compiler) for Basic.
It allows console output (CLI), and with effort, a text based UI.
* VBDos adds "flashy" TUI and event driven programming to DOS applications.
* Visual Basic (3, 4, 5, 6, or "classic") is a Windows GUI development
tool. This involves windows, controls, text boxes, buttons and the
mouse, and is still event driven.
While it's possible to create Win32 CLI applications, it's not supported
natively.
* VBA is a version of the Visual Basic (classic) IDE and engine embedded
into another application, primarily Office. It has no use outside this
environment and can not create CLI applications (or standalone GUI
applications).
* VB.Net is the latest incarnation of the "Basic" environment from
Microsoft and has full support for Win32 CLI and GUI applications.
You seem to be trying to use VB5 to create a CLI application which isn't
going to happen until you learn a lot more (fact, no offence meant,
programming is hard).
As you're working in the world of Windows, it is FAR easier to create a
full Win32 GUI application based on text boxes, buttons, labels, etc.
With VB5, this is SOO easy as that's what its entire design is geared
around. Try this as a starter:
Create a new blank project in VB5, Open the default form, add two text
boxes, a button and a label.
Double click the button and add this between the two lines it added:
Dim Value1 As Single
Dim Value2 As Single
Dim Result as Single
Value1 = Val(Text1.Text) 'Get the number in text box 1
Value2 = Val(Text2.Text) 'Get the number in text box 2
Result = Value1 * Value2 'Simple multiplication to get a result
Label1.Caption = CStr$(Result) 'Put the result in the label
With the help of the many tutorials available online, I'm sure you can
expand on this very basic (pun intended this time :p) multiplication
calculator to do what you want.
Good luck, and just for clarity, if you're learning from scratch, ditch
VB5 and all VB Classics. Go straight to VB.Net. There is no point
learning a 16 year old language and IDE. If you're doing a college
course, then tell the college to ditch VB5 :)
--
Deanna Earley (***@icode.co.uk)
iCatcher Development Team
http://www.icode.co.uk/icatcher/
iCode Systems
(Replies direct to my email address will be ignored. Please reply to the
group.)