IonicWind Software

IWBasic => General Questions => Topic started by: Sterling on August 09, 2009, 08:07:55 AM

Title: APP object equivalent
Post by: Sterling on August 09, 2009, 08:07:55 AM
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?
Title: Re: APP object equivalent
Post by: LarryMc on August 09, 2009, 09:55:31 AM
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
Title: Re: APP object equivalent
Post by: ZeroDog on August 09, 2009, 10:17:06 AM
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 (http://allapi.mentalis.org/agnet/appdown.shtml) then I suggest you do so.  It is a very valuable resource to have when programming. 
Title: Re: APP object equivalent
Post by: Sterling on August 09, 2009, 11:13:16 AM
Thanks, guys, for the pointers. I will definitely look at your suggestions.
Title: Re: APP object equivalent
Post by: ZeroDog on August 09, 2009, 11:18:05 AM
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  :)