HOME | SIGN UP | ACCOUNT | SUBSCRIBE | STORE | WHAT'S NEW | TESTIMONIALS | TROUBLESHOOTING | SUPPORT AREA | SITE NEWS | LOGIN
Classes & methods · News · Jobs · Links · Downloads · Articles · Conferences · Magazines · Training · Consultants · Consulting · Blogs · FAQ
Books · Applications · Meetings · User groups · Speakers · User group leaders · Universal Thread Magazine · Coverages · Photos · Videos

 ID: 37220Created on: June 2, 2009 07:18Updated on: April 22, 2010 21:37

How to run App with right Version / SP
Summary:A commonly problem seems to be to run an app with the VFP Version / SP it is compiled. VFP itself gives not much help on this. But some little compiler commands like #IF and #DEFINES will do the trick.
Rating: Rate this entry
Created by:
Agnes Beste
Berlin

Place on top of your Main Program the following code:

*work for the compiler (might be in some header file):
#IF VERSION(5)<800 THEN
 #DEFINE dnVersion7_Prog					'YES'
* Older then Version  8.00
#ENDIF &&VERSION(5)<800
#IF VERSION(5)<900 THEN
 #DEFINE dnVersion8_Prog					'YES'	
* Older then Version  9.00
#ENDIF &&VERSION(5)<900
#IF VERSION(5)<1000 THEN
 #DEFINE dnVersion9_Prog					'YES'	
* Older then Version 10.00
 #IF RIGHT(VERSION(4),4)='7423' THEN
*SP2 KB968409
  #DEFINE dcV9SP							'7423'
 #ELSE &&RIGHT(VERSION(4),4)='7423'
  #IF RIGHT(VERSION(4),4)='5815' THEN
*SP2
   #DEFINE dcV9SP							'5815'
  #ELSE &&RIGHT(VERSION(4),4)='5815'
   #IF RIGHT(VERSION(4),4)='3504' THEN
    #DEFINE dcV9SP							'3504'
   #ELSE &&RIGHT(VERSION(4),4)='3504'
*VFP9 vanilla
    #DEFINE dcV9SP							'2412'
   #ENDIF &&RIGHT(VERSION(4),4)='3504'
  #ENDIF &&RIGHT(VERSION(4),4)='5815'
 #ENDIF &&RIGHT(VERSION(4),4)='7423'
#ENDIF &&VERSION(5)<1000

*runtime code (need to be in the main prog)
#IFDEF dnVersion7_Prog THEN
 IF VERSION(5)>799 THEN
  MESSAGEBOX('Falsche Version',MB_IconInformation)
  RETURN .F.
 ENDIF &&VERSION(5)>799
#ELSE &&dnVersion7_Prog
 #IFDEF dnVersion8_Prog THEN
  IF !BETWEEN(VERSION(5),800,899) THEN
   MESSAGEBOX('Wrong Version")
   RETURN .F.
  ENDIF &&!BETWEEN(VERSION(5),800,899)
 #ELSE &&dnVersion8_Prog
  #IFDEF dnVersion9_Prog THEN
   IF !BETWEEN(VERSION(5),900,999) THEN
    MESSAGEBOX(''Wrong Version") 
    RETURN .F.
   ENDIF &&!BETWEEN(VERSION(5),900,999)
   IF !RIGHT(VERSION(4),4)==dcV9SP THEN
    MESSAGEBOX("Wrong Servicepack")
    RETURN .F.
   ENDIF &&!RIGHT(VERSION(4),4)==dcV9SP

  #ENDIF &&dnVersion9_Prog
 #ENDIF &&dnVersion8_Prog
#ENDIF &&dnVersion7_Prog

Comments
Add a comment

More entries from this member

  1. How do I know if report is printed May 8, 2009
    When printing, sometimes there is a need to know if a report is printed or not. Since we have no simple way to see if something is realy printed we can at least check if the user send a complete report to the spooler. This article deals with the way to solve this problem with and without object assisted reports (aka listeners).

  2. How to create a custom script with intelliscript June 4, 2004
    Custom scripts are different from scripts that are invoked via a command or function. The big plus to command or function is that custom scripts may invoke everywhere in a line, while command can be invoked only as first word and functions need a "(". There are some problems to write a custom script with intellisense. It is even uneasy to duplicate the examples zloc and zdef that ship with VFP8.0 and beyond. This FAQ points to the steps to create a custom script. It will use a IF .. ENDIF st...

Visual FoxPro DevCon, Praha 2005
DateContentDetail
08/09 17:50NewsSouthwest Fox Speaker Ch...
06/09 16:31MeetingSQL Server Tools, Strate...
02/09 00:44NewsPEM Editor 6 has been re...
27/08 17:57NewsSouthwest Fox 2010 Early...
25/08 04:30NewsCryptoLicensing For .Net...
22/08 09:58NewsWindows Phone 7 Gold Rush
16/08 03:05NewsVisual WebGui reveals it...
11/08 17:54MeetingSo You Think You Want To...
10/08 16:41News.NET Training for VFP Pr...
09/08 18:33MeetingLINQ & SQL Server Reporting
03/08 08:15JobsSQL/VFP Developer for Ma...
29/07 10:59News.NET 4 for VFP Developer...
26/07 10:13JobsVFP Developer (Two Perma...
25/07 06:44NewsWith Visual WebGui 6.4 R...
24/07 11:00JobsQuality Assurance Softwa...

Copyright © 1993 - 2010 Level Extreme Inc., All Rights Reserved · Telephone: 506-783-9007 Email: info@universalthread.com · Privacy & Security · Copyright · Terms & Conditions