October 31, 2025, 02:40:43 PM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


APP object equivalent

Started by Sterling, August 09, 2009, 08:07:55 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Sterling

Not sure if this basic question should post in General Questions or in Boot Camp, but here goes.
Does EBASIC have a feature similar to the Visual Basic 6 APP. object?
In effect, where a program can locate specific information 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?
Also how does a EBASIC program know if it is running in test (development) mode or production (.exe) mode?

LarryMc

Quote
Does EBASIC have a feature similar to the Visual Basic 6 APP. object?
In effect, where a program can locate specific information 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?
Also how does a EBASIC program know if it is running in test (development) mode or production (.exe) mode?
Last first.
In EBasic all programs run as .exe files.
There is a way to determine if a previous instance is running
You wrote the program so you know the title, version info, and file name and can store it in variables or the registry.
The GETSTARTPATH function will give the path to the exe at runtime.
The Help file will be where ever you put it.
In programs written for other user's you can write registry entries as part of your program install and have all the location entries stored there and retrieved as necessary by your application.

Having never used VB I can't answer any better than that.

Larry
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

ZeroDog

While there may not be a specific function that does all that, there are built in functions (and APIs) that will provide all that info.

EBASIC commands:
GETSTARTPATH will return the applications path.
GETCAPTION will return the applications title.

API functions:
GetFileVersionInfo
GetFileAttributes
GetFileSize
GetFileTime

as well as quite a few more.  As for checking if your program is running... I guess you could do this a few ways, such as searching all the open windows for the specific title of your program...  Not sure if there is a function that is specific for that...

As for EBASIC running in test mode, there is no such thing.  EBASIC is not an interpreted language like visual basic or creative basic.  It takes your source code, converts it to assembly, and then uses NASM to create the .exe file.  You cannot run an EBASIC program without compiling an .exe file.


If you have not already downloaded a copy of APIGuide from http://allapi.mentalis.org/agnet/appdown.shtml then I suggest you do so.  It is a very valuable resource to have when programming. 

Sterling

Thanks, guys, for the pointers. I will definitely look at your suggestions.

ZeroDog

If you have any problems using some of the functions, I would be more than happy to help you along. Just post and you shall recieve  :)