At 09:21 AM 3/26/2005, Larry Lustig wrote:

My problem is that I want to write a piece of code that will continue to work
in future releases. If I just check the build to see if it starts with 7.1.80,
or even check to see that the third term is 80 or greater, my code will no
longer work when 7.5 or 8 comes out (since, presumabely, the third term will
then revert to 1 again).


I'm thinking that the best way to do this is to take the first three terms of
the BUILD, concatenate them together to get '7180', convert that to an integer
and then say the resulting number must be 7180 or higher. Does anyone have any
thoughts on that algorithm, or any experience doing this kind of checking?


This is how I validate my applications to make sure that the end users are
taking advantage of the latest features implemented in my applications, such
as R:Docs!

Here's how:

-- Start
-- ValidateVersion.RMD
-- To validate the compatible version of RBG7
-- Author: A. Razzak Memon
CLEAR VAR vCurrentBuild, vCaption, vPauseMsg
SET VAR vCurrentBuild INTEGER = 80
SET VAR vCaption TEXT = 'R:Docs!'
SET VAR vPauseMsg TEXT = +
('MUST have RBG7 Update'&(CTXT(.vCurrentBuild))&'or higher to use'&.vCaption)
IF (INT(SGET(CVAL('BUILD'),2,5))) < .vCurrentBuild THEN
   CLS
   PAUSE 2 USING .vPauseMsg +
   CAPTION .vCaption +
   ICON STOP +
   BUTTON 'Click here to continue ...' +
   OPTION BACK_COLOR WHITE +
   |MESSAGE_COLOR WHITE +
   |MESSAGE_FONT_COLOR RED +
   |BUTTON_COLOR WHITE +
   |BUTTON_FONT_COLOR GREEN +
   |TRANSPARENCY 255
   EXIT
ELSE
   PROPERTY APPLICATION TITLE 'R:Docs'
   CONNECT RDOCS
   RUN GlobalVars.RMD
   QUIT TO RDocs.DAT
ENDIF
RETURN
-- End

Hope that helps!

Very Best R:egards,

Razzak.



Reply via email to