home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 16
/
CD_ASCQ_16_0994.iso
/
news
/
4611
/
fw16d.ins
/
SAMPLES
/
TEST.PRG
< prev
next >
Wrap
Text File
|
1994-06-03
|
3KB
|
96 lines
#include "FIVEWIN.CH"
#define CRLF chr(13) + chr(10)
STATIC oWnd, oDlg, cActualTemp, cNormTemp, Dvalue, cResult, oResult
FUNCTION Main()
LOCAL ;
oBrush, ;
oBar, ;
hBorland
hBorland := loadlibrary("BWCC.DLL")
SET DELETED ON
SET 3DLOOK ON
SET RESOURCES TO "DEVTIME.DLL"
DEFINE BRUSH oBrush STYLE BRICKS
DEFINE WINDOW oWnd FROM 1, 5 TO 20, 75 ;
TITLE "Development Time/Temperature Compensator" ;
BRUSH oBrush ;
MENU DevMenu()
SET MESSAGE OF oWnd TO "Version 1.1"
ACTIVATE WINDOW oWnd MAXIMIZED
//─────────────────────────── Close the resources ─────────────────────────//
SET RESOURCES TO
SET 3DLOOK OFF
freelibrary(hBorland)
RETURN nil
*
FUNCTION ComputeIt()
cActualTemp := 0
cNormDev := space(5)
cResult := space(10)
DEFINE DIALOG oDlg RESOURCE "DEVTIME"
//────────────────── Handle the gets (Edit) controls ──────────────────────//
REDEFINE SAY oResult VAR cResult ID 134 of oDlg
REDEFINE GET oActualTemp VAR cActualTemp ID 101 OF oDlg
REDEFINE GET oNormDev VAR cNormDev ID 103 OF oDlg valid mathit()
//────────────────────── Handle the Chart Button ───────────────────────────//
REDEFINE BUTTON ID 107 OF oDlg ACTION chart()
//────────────────────── Handle the Quit Button ───────────────────────────//
REDEFINE BUTTON ID 108 OF oDlg ACTION oDlg:End()
//─────────────────────────────── Display Everything ──────────────────────//
ACTIVATE DIALOG oDlg CENTERED
RETURN NIL
*
Procedure Chart()
return
*
STATIC FUNCTION DevMenu()
LOCAL oMenu
MENU oMenu
MENUITEM "&Devtime" ACTION computeit()
MENUITEM "&Quit" ACTION ;
If( MsgYesNo( OemToAnsi( "Do you wish to quit?" ),;
OemToAnsi( "Attention" ) ), oWnd:End(),)
ENDMENU
RETURN oMenu
*
Function MathIt()
Cl = .434294
Dvalue = (25*(log(cvt2time(cnormdev))*Cl)+15)
stdtemp=68
dt=cactualtemp-stdtemp
antilog=(Dvalue-(15+dt/2))/25
t = 10.01^antilog
t1 = (t-int(t))*60
cResult = alltrim(str(t,5))+":"+alltrim(str(t1,5))
oResult:Refresh()
* nMsgBox("Adjusted development time = "+alltrim(str(int(t)))+" minutes "+ ;
* alltrim(str(int(t1)))+" seconds @ "+alltrim(str(cactualtemp))+"F")
cActualTemp := 0
cNormDev := space(5)
return .t.
*
function cvt2time(tm)
private x,z,l,p,s
s=alltrim(tm)
x=at(":",s)
z=len(s)
l=60*val(left(s,x-1))
p=val(right(s,z-x))
xtimespnt=l+p
return xtimespnt/60