Get the thermometer form to calculate it's own & value

The place where ProMatrix users can post coding tips and utilities they create.

Get the thermometer form to calculate it's own & value

Postby JessicaLawson » Sun Jun 13, 2010 3:43 pm

by David Le Mesurier

I got tired of trying to remember all the time how to calculate the % value
to pass to the thermometer form, yes I know it's easy, but late night coding
and a few bottles and one makes mistakes easier then normal.

I have altered the Update code at DEV level in my classes and modified the
code from:

LPARAM stnPercent,stcMessage

to

LPARAM stnPercent,stcMessage,stnTotal,stnNow
IF stnPercent = -1
stnPercent = stnNow/(stnTotal/100)
ENDIF
DODEFAULT(stnPercent,stcMessage)


If you pass the total number of records as stnTotal and the current record
number as stnNow then it will calculate it's own percentage.

You can still use it as normal simply by passing a value of not -1 as the %
parameter.

David Le Mesurier
ProMatrix MVP 2005
ProSysPlus MVP Life
JessicaLawson
 
Posts: 79
Joined: Sun Jun 13, 2010 1:23 pm

Re: Get the thermometer form to calculate it's own & value

Postby JessicaLawson » Sun Jun 13, 2010 3:51 pm

David: If you wrote code that ran fast enough you wouldn't need the
Thermometer <s><g>

Nice.
Pete Ryder
JessicaLawson
 
Posts: 79
Joined: Sun Jun 13, 2010 1:23 pm

Re: Get the thermometer form to calculate it's own & value

Postby JessicaLawson » Sun Jun 13, 2010 3:52 pm

Hi Pete,

I know, but even though VFP is very fast to check through 120,000 records
for the common name for animal species and make alternate ones for every
combination of the words in the words in the name and add those records in
takes time and I like to keep the user informed <s>

David
JessicaLawson
 
Posts: 79
Joined: Sun Jun 13, 2010 1:23 pm

Re: Get the thermometer form to calculate it's own & value

Postby JessicaLawson » Sun Jun 13, 2010 3:52 pm

David: Understood.

I actually slow some code loops down intentionally when I want the users to
see the thermometer.

Pete
JessicaLawson
 
Posts: 79
Joined: Sun Jun 13, 2010 1:23 pm


Return to ProMatrix User Library

Who is online

Users browsing this forum: No registered users and 1 guest

cron