The Daily Newbie - Using the App Object
Explains the basics of using the App Object.
Original Author: Matt Roberts
Code
The “To Start Things Love it, hate it, or just don't care, the Daily Newbie is back. I have decided to change the format a little. Although Today’s Topic: Name Derived Used for: VB Help Description: It determines or specifies information Usage: MsgBox "This application is named: " & App.Title Copy & Paste Code:
Daily Newbie
Off Right”
May 8,
2001
the layout is going to be the same as it always was, I am going to start using the PSC Ask A Pro discussion forum
to choose my topics. I find that newbies make up a large part of that forum and they ask some pretty good questions.
Also, if you have a question, email me and I will try to work it in.
The App Object
From:
"Application"
Retriving information about your application at runtime.
about the application's title, version information, the path and name of its executable file and Help files,
and whether or not a previous instance of the application is running.
English: Returns information about the running application.
Syntax: X = App.{Property}
Properties:
Note: This article shows the most common and useful properties for the App object. There are a total of 30
properties that you can access from code.
protection when creating reusable objects (.dll's or .ocx's)
ActiveX .dll's or
the help file exists before trying to open it.
run from.
EXEName, since EXE's can be renamed at will.
Methods:
log path that was specified in the StartLogging method.
Example:
To find out what path the .exe is running from: MsgBox "The application is running from " & App.Path
Today's code snippet returns a list of information about the current
application:
Debug.Print "Application Name: " & App.Title
Debug.Print "Running From: " & App.Path
Debug.Print "Version = " & App.Major & "." & App.Minor & App.Minor
Some Notes about the App Object:
If App.PrevInstance = True Then
MsgBox App.Title & " is already running.
End If
Open App.Path & "customer.dat" For Input As #1
The App Object makes it easy to do some things that otherwise would be very difficult to do in VB. The App.Path property is
especially helpful when creating applications that manipulate files. Any comments about this article are welcome.
Loading Comments ...
Comments
No comments have been added for this post.
You must be logged in to make a comment.