Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get version number from EXE... 2

Status
Not open for further replies.

Neil Toulouse

Programmer
Joined
Mar 18, 2002
Messages
882
Location
GB
Again I am guessing that this has already been answered somewhere on the forum!!

Could you tell me how you get the version number from the version page tab of the file properties when you right-click on the EXE file?

TIA
Neil "I like work. It fascinates me. I can sit and look at it for hours..."
 
Hi

1. AGETFILEVERSION(myFile,SYS(16))

where myFile is your executable.


2. If you are looking from the VFP main menu.. use the Build button.. and then the Version button

:-) ramani :-)
(Subramanian.G),FoxAcc, ramani_g@yahoo.com

 
Thanks for that!

However, the syntax in the help is:

nRows = AGetFileVersion( VersionArray, cFileName )

...so have changed accordingly!

Neil "I like work. It fascinates me. I can sit and look at it for hours..."
 
Neil,

For a dynamic version that works on the "Current" .exe file, try this:

Create a form property called cVersion

Then in the form's init put in:

AGETFILEVERSION(ThisForm.aVersion,SYS(16,0))
ThisForm.cVersion = ThisForm.aVersion(1,4)

Of course you can parse the aVersion down as well to only get the four digit build value with something like:

ThisForm.cVersion = 'Build' + RIGHT(ThisForm.aVersion(1,4),4)

which I find handy for just displaying the build value. Because I'm a little lazy, and because I like 4 digit build numbers, I always set my version build to 1000 when starting the first build.

Best Regards,
Scott

"Everything should be made as simple as possible, and no simpler."[hammer]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top