Page 1 of 1

Visual Studio 6

Posted: Tue Nov 26, 2002 11:13 pm
by Berserk
Hey,

I was just wondering i use Visual C++ alot, but what does Visual FoxPro & Visual InterDev do?????

Also, (note: i don't want to learn Visual Basic) i was just wondering could somebody give me a simple Visual Basic program that i can compile and look at, i just want it to say hello world. I am just curious how VB looks like ;)

Ciao ;D

Re:Visual Studio 6

Posted: Wed Nov 27, 2002 12:21 am
by Schol-R-LEA
Visual FoxPro the Windows version of the FoxPro database system, the last vestige of the xBase systems (dBase, Clipper, et . al.) that dominated the PC database market before Access came out. It is there primarily to support legacy code, much of it quite old by Windows standards, and is of little interest to most people otherwise. I know a bit of it, as I did some DOS FoxPro stuff about eight years ago (quite late for that sort of thing), and in 1998 worked in VFP fixing some medical databases during a big Y2K-remediation project.

Visual InterDev is the Visual Studio HTML editor, kind of an industrial-strength afFrontPage without the automatic upload and synch features, but with considerably better support for scripting and style sheets, IIRC.

It's been a while since I've used either of the them, so I don't know what they are like these days; you may want to read through MicroSoft's web site about them, and maybe STW for more info. I never much liked either of them, to be honest, but you have to work with the tools you're given.

Re:Visual Studio 6

Posted: Wed Nov 27, 2002 10:55 am
by Schol-R-LEA
As for the Visual Basic question - STFW. I hate being rude about it, but there are literally millions of pages which have examples of VB code online. For that matter, any bookstore or library should have a double dozen VB primers which you could take a peek at. A search on Visual Basic "Hello, World!" brings up dozens of examples, including ones from MicroSoft themselves.

You have to learn how to do your own research. Using Google isn't rocket science. I'd be happy to help with any specific question you have (e.g., "Why are there four different ways of calling a function?" - OK, bad example, I doubt that even M$'s own developers could give a good explanation for that) but the really general and basic things like these can be found faster and easier on your own, as I've told you before. I mean, you could have gone to Microsoft's own website to get the answers to the first two questions, without any trouble at all.

Oh, hell, I might as well give you an answer anyway. From the immediate window, you can simply run

Code: Select all

msgbox "Hello, World!", vbOKOnly, "Hello, World!"
Which should pop up a messagebox with both the title and the body reading, "Hello, World!" (VB has no console mode, at least not prior to VB .NET). For a more elaborate (if rather unusual) example, see the ACM "Hello, World!" Project (a good page to look at in general). See the Google link above for scads and scads of other examples.

One thing to notice about VB is that generally speaking, you would not start with code but with a form, and IIUC, all standalone VB programs need to have at least one (or at least they did before VB .NET). While you can generate forms by means of code, the IDE strongly encourages the use of the visual tools; you would almost never write a program entirely as code in the conventional sense. This makes it rather hard to show an example without a lot of screenshots, as you no doubt see in the tutorials.

I should also add that, for all my dislike of it, it really valuable (indeed, very nearly required) to learn Visual Basic for Applications if you are doing any extensive Windows work. While I would recommend having a decent background in a few other languages first to help avoid getting into any bad habits (I say the same thing about C++, too), VBA is something that won't hurt you to know.

Re:Visual Studio 6

Posted: Wed Nov 27, 2002 9:48 pm
by smartguy240
Actually in VB it would have to be


Dim intButton as Integer
' ' ' ' '
intButton = MsgBox("Hello, World!", vbOKOnly, "Hello, World!")

When you use anytihng other than the Text...ummm it is called Prompt... you have to define it is a variable...just because if you dont it says that = is requred also you have to have (parenthesis) around the command

Re:Visual Studio 6

Posted: Wed Nov 27, 2002 10:04 pm
by PlayOS
Actually the code that Schol-R-LEA posted is perfectly valid, and I have used code exactly like that numerous times and never had a problem, you only need to do what you said if you are expecting to get a response from the message box. :)

Re:Visual Studio 6

Posted: Wed Nov 27, 2002 10:09 pm
by PlayOS
Also, if a program is dependant upon the respone you should make the application wait for the response like this

Dim a As Integer

a = MsgBox("A Msg", vbOKCancel Or vbApplicationModal, "Title")

;)

Re:Visual Studio 6

Posted: Thu Nov 28, 2002 1:31 am
by Schol-R-LEA
I think that this confusion here is a result of something I alluded to in my message: the fact that there are four different ways to call a function or subroutine, each of which has different side effects. To call a function for it's value in VB 6 and earlier, you would use

Code: Select all

retval = myFun(arg1, arg2, arg3)
Whereas to call a subroutine (or to call a function for it's side effect only, dropping the return value) you would use one of two ways:

Code: Select all

mySub arg1, arg2, arg3
Call myFun(arg1, arg2, arg3)
Each of these passes arguments by reference by default. Furthermore, IIRC, using [tt]Call[/tt] overrides [tt]ByVal[/tt] declarations, forcing all arguments to [tt]ByRef[/tt] regardless of how the function delared them.

I now have a reference on VB .NET and I see that this is no longer the case; all subroutine and function calls now must use parentheses, [tt]Call[/tt] is only used with subroutines (optionally), and arguments are now passed by value by default. While this does make the language more consistent, it also drives home the risks involved in using a proprietary development tool - a lot of VB programs break with this one change, and it is but one of many sweeping alterations that I can see. Now I understand why so many VB programers were up in arms about it - even though the changes were for the most part good ones, they require programmmers to completely learn the language over practically from the beginining. It really is a different language from VB 6, more divergent than C++ is from C.

Re:Visual Studio 6

Posted: Tue Dec 03, 2002 11:47 pm
by yourgovind
In visual basic i want to create a database through coding. i write the code for that as following but it give some error error name is datatype convertion error

dim ws as workspace
dim db as database
dim ta as tabledef
set ws = DbEngine.workspace(0)
set db = ws.CreateDatabase("databasename",Dbgeneral,DbEncrypt)

..
..
..
as same as table creation



actually ican create the database and tables and then fields through coding without input

but how to create the database for given name through the input box or text box. not direct coding