[futurebasic] Re: [FB] CFPreferencesGetAppIntegerValue(...)

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : May 2005 : Group Archive : Group : All Groups

From: Bernie <fblist@...>
Date: Sun, 22 May 2005 15:36:34 +0100
Steve wrote:

> On May 22, 2005, at 9:57 AM, Bernie wrote:
>
>> Think I've fixed it. Defining "value" as SInt32 (instead of short)  
>> makes it work.
>
> Interesting...
>
> Bernie, do you have code for your app that checks for updates at  
> your web site ?

Are you offering or do you want some?

The old version of TWM uses something else but this is what I'm  
planning to use in the CE version. It started life in an example by  
Ken. If you or anyone else has something better, please send it on over.

Bernie


'----------
/*
Check version

Unfinished -- need to get app's version from plist for comparison
*/
local mode
local fn DisplayStandardAlertDialog(param1 as Str255, param2 as Str255)
'~'1
dim as AlertStdAlertParamRec alertParam
dim as short               @ itemHit
dim as OSErr                 err
'~'1
alertParam.movable       = _true
alertParam.helpButton    = _false
alertParam.filterProc    = 0
alertParam.defaultText   = _kAlertDefaultOKText
alertParam.cancelText    = 0
alertParam.otherText     = 0
alertParam.defaultButton = _kAlertStdAlertOKButton
alertParam.cancelButton  = 0
alertParam.position      = _kWindowDefaultPosition
err = fn StandardAlert(_kAlertStopAlert, param1, param2, alertParam,  
itemHit)
end fn

local mode
local fn CheckVers
'~'1
dim as Str255 param1, param2
dim as Str15  thisVers, newVers
'~'1
newVers = ""
open "UNIX", 1, "curl -LsS http://homepage.ntlworld.com/bernie.w/ 
TWMVers "
do
line input #1, newVers
until eof(1)
close 1

long if newVers

//need to get app's version from plist here
//thisVers = ????

long if val(newVers) == 200//thisVers
param1 = "Your version is current"
param2 = ""
xelse
param1 = "There is a new version of TWM available"
param2 = "Please visit: http//:homepage.ntlworld.com/bernie.w/twm.htm"
end if
fn DisplayStandardAlertDialog(param1, param2)
xelse

beep

end if
end fn
'----------

--
To unsubscribe, send ANY message to: futurebasic-unsubscribe@...