{ ****************************************** Program Name : Quick MW ( Quick Molecular Weights ) Date : March 17, 1995 Author : Thomas P. De Stein Address : 409 Bradfield Hall Dept. of Plant Breeding Cornell University Ithaca, NY 14853 tpd3@cornell.edu (607) 255-9951 ****************************************** These macros can be used to quickly calculate the molecular weights from an image of a electrophoretic gel captured with a camera. They are labeled Lambda=n because the standard control used in our lab is typically lambda. These macros can easily be adapted to work with other standards as needed. Lambda standards typically have seven bands, but because the smaller mw bands occationally don't show clearly on the gels, there are multiple macros with a number indicating the number of visible bands. The first macro is commented, however, the others are not. The macros use all the same basic code, and the comments in the first one will apply to all the others. The only differences, are the calculation parameters which are hard coded into the program. The individual macros will utilize all available standard bands, maximizing curve parameter accuracy. The macros therefore have different curve starting and ending points, and also have different "cut off" points (the distance value at which it has been decided to use one set of curve parameters or another.) A general overview of these macros is as follows. Apon entry, first the known standard sizes(in Kb) are assigned and the cut off points are set. The program will repetedly capture frames from a camera until a mouse button is depressed. The program will then accept an origin, then the (in this case) seven standard bands. The program will then perform (in this case) four calculations by passing a statring point, ending point and a curve number to the routine RegressIt(). The The four curve parameters are set in storage called lo(n), mo(n), and cbar(n); n - representing the curve number. There are four cut off points. These are the points at which the program decides which set of curve parameters to use to calculate a molecular weight. The macro will continuously collect x,y positions and calculate molecular weights until the upper right box labeled 'End Macro' is clicked. Directions: 1) Zoom in on the gel as much as possible, (the more pixels used, the more accurate the estimation of molecular weight.) 2) Load the macro and exacute the macro corresponding to number of standard bands you have. 3) Align the gel with the verticle flashing line. Try to align the start of the well with the line. If not possible, just make sure the wells are as perpendicular to the line as possable. 4) Click on the screen anywhere to capture the image. 5) Click on the 'Origin' (the start of the wells, or any referrence point) The macro will beep. 6) Cilck on the standard bands. The macro will beep and mark the spots you clicked. 7) After the standards have been entered, you can click away on the bands of interest. 8) To assist further processing of data, the boxes on the upper right will place a 4 or 5 in the data file to mark the end of a lane or the end of the input respectivly. (end of lane is optional) 9) Clicking on 'End Macro' will show a list of molecular weights and codes in the results window. This data can be saved as a text file to be processed in a spreadsheet(space delimited text) or any other program.(you must save the data before closing the window.) The following procedure is a translation of an algorithm created by H.E. Schaffer and R.R. Sederoff. For information regarding this algorithm, please refer to the following article: Schaffer, H. E. and Sederoff, R. R., 1981 Improved estimation of DNA fragment lengths from algarose gels. Analytical Biochemistry 115:113-122. This procedure is passed a starting point, an ending point, and the number of the number of the curve being estimated. It will perform a least square estimation on the data stored in the two user accessable arrays between the starting and ending point. Because there are only two user arrays for storing data, the temporary storage of data is performed on the same two arrays, but the indexing is offset to an area of the arrays which are not in use. This may may make it hard to trace through the code, however, it does enable the program to be small enough to function as a macro. } Procedure RegressIt(first,last,regnum : integer); var num, { the number of pairs of data points } i : integer; mwt,mdist,mprod, { The mean weights,distances, and products } swt,sdist,sprod, { The sums of the weights, dist. ... } det, cssl,cssm,cscpml, { Misc. calculation storage } cspmll,cspmlm,sc : real; Begin swt := 0.0; sdist := 0.0; sprod := 0.0; { Initializes Storage } cssl := 0.0; cscpml := 0.0; cssm := 0.0; cspmll := 0.0; cspmlm := 0.0; sc := 0.0; SetPrecision(8); { Maximizes the precision of the calculations } num := ((last - first) + 1); { Determines the number of data pairs } for i := first to last do Begin { For further info on this part, please refer to the} swt := (swt + rUser1[i]); {above mentioned article} sdist :=(sdist +rUser2[i]); ruser1[i +10] := (rUser1[i]*ruser2[i]); sprod := (sprod + ruser1[i+10]); end; mwt := (swt/num); mdist := (sdist/num); mprod := (sprod/num); for i := first to last do begin ruser1[i+20] := (rUser1[i] - mwt); ruser1[i+30] := (rUser2[i] - mdist); ruser1[i+40] := (ruser1[i + 10] - mprod); end; for i := first to last do begin cssl := (cssl + (ruser1[i + 20] * ruser1[i + 20])); cssm := (cssm + (ruser1[i + 30] * ruser1[i + 30])); cscpml := (cscpml + (ruser1[i + 20] * ruser1[i + 30])); cspmll := (cspmll + (ruser1[i + 40] * ruser1[i + 20])); cspmlm := (cspmlm + (ruser1[i + 40] * ruser1[i + 30])); end; det := ((cssl*cssm)-(cscpml*cscpml)); ruser2[regnum+10] := (((cssm*cspmll)-(cscpml*cspmlm))/det); ruser2[regnum + 20] := (((-1 * cscpml*cspmll)+(cssl*cspmlm))/det); for i := first to last do begin ruser1[i + 50] :=((ruser1[i] - ruser2[20 + regnum])*(ruser2[i] - ruser2[10+regnum])); sc :=(ruser1[50 +i] - ruser1[50 + first]); end; ruser2[30 + regnum] := ((sc/num)+ruser1[50 + first]); end; { The lable of this macro contains the name "Lambda=7" and also the shortcut code "/7". After loading the macro, The name will appear as a menu item, and it can be initiated by the short cut "command-key-7" or in the normal drag menu manner. } Macro 'Lambda=7 /7'; Var X,Y, {Cursor positions} i,j, {Loop counters} Origin, : Integer; {The origin/ Beginning of the Gel} mo1,lo1,cbar1,Cut1,Bot1, mo2,lo2,cbar2,Cut2,Bot2, mo3,lo3,cbar3,Cut3,Bot3, {Storage for curve parameters } mo4,lo4,cbar4,Cut4,Bot4, Temp : real; Flag1,Flag2, {Loop Flags} EndBlot, {Signals the end of the blot} OffSet : boolean; {Used when printing data on screen to offset the numbers} Begin rUser1[1] := 23.1; rUser1[2] := 9.4; rUser1[3] := 6.6; rUser1[4] := 4.4; {Assignment of the known distances} rUser1[5] := 2.3; rUser1[6] := 2.0; rUser1[7] := 0.6; Cut1 := 8.0; Cut2 := 5.0; {Assignment of the cut off points} Cut3 := 2.15; Cut4 := 0.0; SetOptions('User1,User2'); {Sets the results window to only show User arrays} SetUser1Label('MW '); {Lables the user arrays on the results window} SetUser2Label('CODE'); {This loop captures camera frames so the user can align the blot in a verticle position . The loop ends when a mouse button is depressed.} Capture; SetLineWidth(1); {Sets the width for new lines} While Not Button do Begin Capture; {switches between capture and draw} MoveTo(20,0); LineTo(20,480); End; Wait(1); MoveTo(20,0); LineTo(20,480); SetLineWidth(2); {Resets the width for new lines} MoveTo(570,0); {Draws Boxs(Buttons) in upper right} LineTo(570,70); MoveTo(570,35); LineTo(639,35); MoveTo(570,70); LineTo(639,70); MoveTo(580,17); DrawText('End Macro'); MoveTo(580,52); DrawText('End Lane'); Flag1 := True; While Flag1 do Begin if Button then {This loop will cycle until the user "Clicks On" the origin} Begin GetMouse(X,Y); Beep; Origin := X; Wait(0.5); Flag1 := False; End; End; i := 1; While (i <= 7) do Begin if button then {This loop will cycle until the user has clicked on seven lambda bands} Begin GetMouse(X,Y); Beep; rUser2[i]:=X-Origin; MoveTo(X,(Y-5)); LineTo(X,(Y+5)); i := i + 1; wait(0.5); End; End; RegressIt(1,3,1); {Calculates the first set of curve parameters} mo1 := ruser2[11]; lo1 := ruser2[21]; {Assignes them to storage} cbar1:= ruser2[31]; Bot1 := ((cbar1/(Cut1-lo1))+ mo1); {Converts the cut off point in Kb to y position distances} RegressIt(2,4,2); mo2 := ruser2[12]; {Curve Two} lo2 := ruser2[22]; cbar2:= ruser2[32]; Bot2 := ((cbar2/(Cut2-lo2))+ mo2); RegressIt(3,6,3); mo3 := ruser2[13]; {Curve Three} lo3 := ruser2[23]; cbar3:= ruser2[33]; Bot3 := ((cbar3/(Cut3-lo3))+ mo3); RegressIt(5,7,4); mo4 := ruser2[14]; {Curve Four} lo4 := ruser2[24]; cbar4:= ruser2[34]; Bot4 := ((cbar4/(Cut4-lo4))+ mo4); {This loop will calculate the estimated values for lambda using the newly calculated curve parameters} for i := 1 to 7 do Begin if(rUser2[i] <= bot1) then ruser1[i] := (cbar1/((ruser2[i])-mo1)+lo1); if((ruser2[i] > bot1) and (ruser2[i] <= bot2)) then ruser1[i] := (cbar2/((ruser2[i])-mo2)+lo2); if((ruser2[i] > bot2 ) and ( ruser2[i]<= bot3)) then ruser1[i] := (cbar3/((ruser2[i])-mo3)+lo3); if (ruser2[i] > bot3) then ruser1[i] := (cbar4/((ruser2[i])-mo4)+lo4); ruser2[i] := 0.0; End; {The following loop will continually cycle until the user has clicked on a band or in one of the boxes in the upper right. If the user clicks on the box labled "End of Blot ", the program terminates and presents the calculated molecular weights in the results window. If the user clicks on the box labled "New Lane" a number four will be placed in the intensity column of the results to indicate the start of the new lane. It will then wait for the user to click on the origin of the new lane. Otherwise, the loop will determine the molecular weight and print it on the screen.} EndBlot := False; OffSet := True; While Not EndBlot do Begin if Button then Begin {Gets the position of the mouse click} GetMouse(X,Y); Beep; Flag1 := True; if ((X > 569) and (Y< 35)) then {If the click was in the End of Blot box, it} Begin {terminated the loop by seting the EndBlot flag} EndBlot := True; i := i + 1; rUser1[i] := 0.0; rUser2[i] := 5.0; {Lables the output with a five to indicate the} Flag1 := False; {end of the blot.} End; if((X > 569) and ((Y < 70) and ( Y > 35))) then Begin {if the click was in the End Lane box} i := i +1; rUser1[i] := 0.0; rUser2[i] := 4.0; {Lables the output with a 4} Flag1 := False; End; {This section determines the molecular weightes and prints them on the screen.} if Flag1 then Begin i := i +1; MoveTo(X,(Y-5)); LineTo(X,(Y+5)); if(X <= Bot1)then Temp := (cbar1/((X-Origin)-mo1)+lo1); {Calculates the molecular weights} if((X> Bot1) and (X <= Bot2)) then Temp := (cbar2/((X-Origin)-mo2)+lo2); if((X > bot2 ) and (X<= Bot3)) then Temp := (cbar3/((X-Origin)-mo3)+lo3); if(X > bot3)then Temp := (cbar4/((X-Origin)-mo4)+lo4); rUser1[i] := Temp; ruser2[i] := 1; SetPrecision(1); if OffSet then {prints the numbers on the screen in a ziz-zag fashion} Begin {to keep the numbers from being written on top of each other} MoveTo(X-5,Y+8); OffSet := False; End else Begin MoveTo(X+7,Y-8); OffSet := True; End; DrawNumber(Temp); SetPrecision(3); {Gets the band intensity from the user} End; End; { End if Button} End; { End While not EndBlot } SetCounter(i); {Tells how many sets of the user array data points should be displayed in the results window} ShowResults; End; { Ends the macro Lambda=7 } Macro 'Lambda=6 /6'; Var X,Y, i,j, Origin, : Integer; mo1,lo1,cbar1,Cut1,Bot1, mo2,lo2,cbar2,Cut2,Bot2, mo3,lo3,cbar3,Cut3,Bot3, mo4,lo4,cbar4,Cut4,Bot4, Temp : real; Flag1,Flag2, EndBlot, OffSet : boolean; Begin rUser1[1] := 23.1; rUser1[2] := 9.4; rUser1[3] := 6.6; rUser1[4] := 4.4; rUser1[5] := 2.3; rUser1[6] := 2.0; Cut1 := 8.0; Cut2 := 5.0; Cut3 := 2.15; Cut4 := 0.0; SetOptions('User1,User2'); SetUser1Label('MW '); SetUser2Label('CODE'); Capture; SetLineWidth(1); While Not Button do Begin Capture; MoveTo(20,0); LineTo(20,480); End; Wait(1); MoveTo(20,0); LineTo(20,480); SetLineWidth(2); MoveTo(570,0); LineTo(570,70); MoveTo(570,35); LineTo(639,35); MoveTo(570,70); LineTo(639,70); MoveTo(580,17); DrawText('End Macro'); MoveTo(580,52); DrawText('End Lane'); Flag1 := True; While Flag1 do Begin if Button then Begin GetMouse(X,Y); Beep; Origin := X; Wait(0.5); Flag1 := False; End; End; i := 1; While (i <= 6) do Begin if button then Begin GetMouse(X,Y); Beep; rUser2[i]:=X-Origin; MoveTo(X,(Y-5)); LineTo(X,(Y+5)); i := i + 1; wait(0.5); End; End; RegressIt(1,3,1); mo1 := ruser2[11]; lo1 := ruser2[21]; cbar1:= ruser2[31]; Bot1 := ((cbar1/(Cut1-lo1))+ mo1); RegressIt(2,4,2); mo2 := ruser2[12]; lo2 := ruser2[22]; cbar2:= ruser2[32]; Bot2 := ((cbar2/(Cut2-lo2))+ mo2); RegressIt(3,5,3); mo3 := ruser2[13]; lo3 := ruser2[23]; cbar3:= ruser2[33]; Bot3 := ((cbar3/(Cut3-lo3))+ mo3); RegressIt(4,6,4); mo4 := ruser2[14]; lo4 := ruser2[24]; cbar4:= ruser2[34]; Bot4 := ((cbar4/(Cut4-lo4))+ mo4); for i := 1 to 6 do Begin if(rUser2[i] <= bot1) then ruser1[i] := (cbar1/((ruser2[i])-mo1)+lo1); if((ruser2[i] > bot1) and (ruser2[i] <= bot2)) then ruser1[i] := (cbar2/((ruser2[i])-mo2)+lo2); if((ruser2[i] > bot2 ) and ( ruser2[i]<= bot3)) then ruser1[i] := (cbar3/((ruser2[i])-mo3)+lo3); if (ruser2[i] > bot3) then ruser1[i] := (cbar4/((ruser2[i])-mo4)+lo4); ruser2[i] := 0.0; End; EndBlot := False; OffSet := True; While Not EndBlot do Begin if Button then Begin GetMouse(X,Y); Beep; Flag1 := True; if ((X > 569) and (Y< 35)) then Begin EndBlot := True; i := i + 1; rUser1[i] := 0.0; rUser2[i] := 5.0; Flag1 := False; End; if((X > 569) and ((Y < 70) and ( Y > 35))) then Begin i := i +1; rUser1[i] := 0.0; rUser2[i] := 4.0; Flag1 := False; End; if Flag1 then Begin i := i +1; MoveTo(X,(Y-5)); LineTo(X,(Y+5)); if(X <= Bot1)then Temp := (cbar1/((X-Origin)-mo1)+lo1); if((X> Bot1) and (X <= Bot2)) then Temp := (cbar2/((X-Origin)-mo2)+lo2); if((X > bot2 ) and (X<= Bot3)) then Temp := (cbar3/((X-Origin)-mo3)+lo3); if(X > bot3)then Temp := (cbar4/((X-Origin)-mo4)+lo4); rUser1[i] := Temp; ruser2[i] := 1; SetPrecision(1); if OffSet then Begin MoveTo(X-5,Y+8); OffSet := False; End else Begin MoveTo(X+7,Y-8); OffSet := True; End; DrawNumber(Temp); SetPrecision(3); End; End; End; SetCounter(i); ShowResults; End; Macro 'Lambda=5/5'; Var X,Y, i,j, Origin, : Integer; mo1,lo1,cbar1,Cut1,Bot1, mo2,lo2,cbar2,Cut2,Bot2, mo3,lo3,cbar3,Cut3,Bot3, Temp : real; Flag1,Flag2, EndBlot, OffSet : boolean; Begin rUser1[1] := 23.1; rUser1[2] := 9.4; rUser1[3] := 6.6; rUser1[4] := 4.4; rUser1[5] := 2.3; Cut1 := 8.0; Cut2 := 5.0; Cut3 := 0.0; SetOptions('User1,User2'); SetUser1Label('MW '); SetUser2Label('CODE'); Capture; SetLineWidth(1); While Not Button do Begin Capture; MoveTo(20,0); LineTo(20,480); End; Wait(1); MoveTo(20,0); LineTo(20,480); SetLineWidth(2); MoveTo(570,0); LineTo(570,70); MoveTo(570,35); LineTo(639,35); MoveTo(570,70); LineTo(639,70); MoveTo(580,17); DrawText('End Macro'); MoveTo(580,52); DrawText('End Lane'); Flag1 := True; While Flag1 do Begin if Button then Begin GetMouse(X,Y); Beep; Origin := X; Wait(0.5); Flag1 := False; End; End; i := 1; While (i <= 5) do Begin if button then Begin GetMouse(X,Y); Beep; rUser2[i]:=X-Origin; MoveTo(X,(Y-5)); LineTo(X,(Y+5)); i := i + 1; wait(0.5); End; End; RegressIt(1,3,1); mo1 := ruser2[11]; lo1 := ruser2[21]; cbar1:= ruser2[31]; Bot1 := ((cbar1/(Cut1-lo1))+ mo1); RegressIt(2,4,2); mo2 := ruser2[12]; lo2 := ruser2[22]; cbar2:= ruser2[32]; Bot2 := ((cbar2/(Cut2-lo2))+ mo2); RegressIt(3,6,3); mo3 := ruser2[13]; lo3 := ruser2[23]; cbar3:= ruser2[33]; Bot3 := ((cbar3/(Cut3-lo3))+ mo3); for i := 1 to 5 do Begin if(rUser2[i] <= bot1) then ruser1[i] := (cbar1/((ruser2[i])-mo1)+lo1); if((ruser2[i] > bot1) and (ruser2[i] <= bot2))then ruser1[i] := (cbar2/((ruser2[i])-mo2)+lo2); if(ruser2[i] > bot2)then ruser1[i] := (cbar3/((ruser2[i])-mo3)+lo3); ruser2[i] := 0.0; End; EndBlot := False; OffSet := True; While Not EndBlot do Begin if Button then Begin GetMouse(X,Y); Beep; Flag1 := True; if ((X > 569) and (Y< 35)) then Begin EndBlot := True; i := i + 1; rUser1[i] := 0.0; rUser2[i] := 5.0; Flag1 := False; End; if((X > 569) and ((Y < 70) and ( Y > 35))) then Begin i := i +1; rUser1[i] := 0.0; rUser2[i] := 4.0; Flag1 := False; End; if Flag1 then Begin i := i +1; MoveTo(X,(Y-5)); LineTo(X,(Y+5)); if(X <= Bot1)then Temp := (cbar1/((X-Origin)-mo1)+lo1); if((X> Bot1) and (X <= Bot2)) then Temp := (cbar2/((X-Origin)-mo2)+lo2); if(X > bot2 )then Temp := (cbar3/((X-Origin)-mo3)+lo3); rUser1[i] := Temp; ruser2[i] := 1; SetPrecision(1); if OffSet then Begin MoveTo(X-5,Y+8); OffSet := False; End else Begin MoveTo(X+7,Y-8); OffSet := True; End; DrawNumber(Temp); SetPrecision(3); End; End; End; SetCounter(i); ShowResults; End; Macro 'Lambda=4 /4'; Var X,Y, i,j, Origin, : Integer; mo1,lo1,cbar1,Cut1,Bot1, mo2,lo2,cbar2,Cut2,Bot2, Temp : real; Flag1,Flag2, EndBlot, OffSet : boolean; Begin rUser1[1] := 23.1; rUser1[2] := 9.4; rUser1[3] := 6.6; rUser1[4] := 4.4; Cut1 := 8.0; Cut2 := 0.0; SetOptions('User1,User2'); SetUser1Label('MW '); SetUser2Label('CODE'); Capture; SetLineWidth(1); While Not Button do Begin Capture; MoveTo(20,0); LineTo(20,480); End; Wait(1); MoveTo(20,0); LineTo(20,480); SetLineWidth(2); MoveTo(570,0); LineTo(570,70); MoveTo(570,35); LineTo(639,35); MoveTo(570,70); LineTo(639,70); MoveTo(580,17); DrawText('End Macro'); MoveTo(580,52); DrawText('End Lane'); Flag1 := True; While Flag1 do Begin if Button then Begin GetMouse(X,Y); Beep; Origin := X; Wait(0.5); Flag1 := False; End; End; i := 1; While (i <= 4) do Begin if button then Begin GetMouse(X,Y); Beep; rUser2[i]:=X-Origin; MoveTo(X,(Y-5)); LineTo(X,(Y+5)); i := i + 1; wait(0.5); End; End; RegressIt(1,3,1); mo1 := ruser2[11]; lo1 := ruser2[21]; cbar1:= ruser2[31]; Bot1 := ((cbar1/(Cut1-lo1))+ mo1); RegressIt(2,4,2); mo2 := ruser2[12]; lo2 := ruser2[22]; cbar2:= ruser2[32]; Bot2 := ((cbar2/(Cut2-lo2))+ mo2); for i := 1 to 4 do Begin if(rUser2[i] <= bot1) then ruser1[i] := (cbar1/((ruser2[i])-mo1)+lo1); if(ruser2[i] > bot1) then ruser1[i] := (cbar2/((ruser2[i])-mo2)+lo2); ruser2[i] := 0.0; End; EndBlot := False; OffSet := True; While Not EndBlot do Begin if Button then Begin GetMouse(X,Y); Beep; Flag1 := True; if ((X > 569) and (Y< 35)) then Begin EndBlot := True; i := i + 1; rUser1[i] := 0.0; rUser2[i] := 5.0; Flag1 := False; End; if((X > 569) and ((Y < 70) and ( Y > 35))) then Begin i := i +1; rUser1[i] := 0.0; rUser2[i] := 4.0; Flag1 := False; End; if Flag1 then Begin i := i +1; MoveTo(X,(Y-5)); LineTo(X,(Y+5)); if(X <= Bot1)then Temp := (cbar1/((X-Origin)-mo1)+lo1); if(X> Bot1) then Temp := (cbar2/((X-Origin)-mo2)+lo2); rUser1[i] := Temp; ruser2[i] := 1; SetPrecision(1); if OffSet then Begin MoveTo(X-5,Y+8); OffSet := False; End else Begin MoveTo(X+7,Y-8); OffSet := True; End; DrawNumber(Temp); SetPrecision(3); End; End; End; SetCounter(i); ShowResults; End; Macro 'Lambda=3/3'; Var X,Y, i,j, Origin, : Integer; mo1,lo1,cbar1,Cut1,Bot1, Temp : real; Flag1,Flag2, EndBlot, OffSet : boolean; Begin rUser1[1] := 23.1; rUser1[2] := 9.4; rUser1[3] := 6.6; Cut1 := 0.0; SetOptions('User1,User2'); SetUser1Label('MW '); SetUser2Label('CODE'); Capture; SetLineWidth(1); While Not Button do Begin Capture; MoveTo(20,0); LineTo(20,480); End; Wait(1); MoveTo(20,0); LineTo(20,480); SetLineWidth(2); MoveTo(570,0); LineTo(570,70); MoveTo(570,35); LineTo(639,35); MoveTo(570,70); LineTo(639,70); MoveTo(580,17); DrawText('End Macro'); MoveTo(580,52); DrawText('End Lane'); Flag1 := True; While Flag1 do Begin if Button then Begin GetMouse(X,Y); Beep; Origin := X; Wait(0.5); Flag1 := False; End; End; i := 1; While (i <= 3) do Begin if button then Begin GetMouse(X,Y); Beep; rUser2[i]:=X-Origin; MoveTo(X,(Y-5)); LineTo(X,(Y+5)); i := i + 1; wait(0.5); End; End; RegressIt(1,3,1); mo1 := ruser2[11]; lo1 := ruser2[21]; cbar1:= ruser2[31]; Bot1 := ((cbar1/(Cut1-lo1))+ mo1); for i := 1 to 3 do Begin ruser1[i] := (cbar1/((ruser2[i])-mo1)+lo1); ruser2[i] := 0.0; End; EndBlot := False; OffSet := True; While Not EndBlot do Begin if Button then Begin GetMouse(X,Y); Beep; Flag1 := True; if ((X > 569) and (Y< 35)) then Begin EndBlot := True; i := i + 1; rUser1[i] := 0.0; rUser2[i] := 5.0; Flag1 := False; End; if((X > 569) and ((Y < 70) and ( Y > 35))) then Begin i := i +1; rUser1[i] := 0.0; rUser2[i] := 4.0; Flag1 := False; End; if Flag1 then Begin i := i +1; MoveTo(X,(Y-5)); LineTo(X,(Y+5)); Temp := (cbar1/((X-Origin)-mo1)+lo1); rUser1[i] := Temp; ruser2[i] := 1; SetPrecision(1); if OffSet then Begin MoveTo(X-5,Y+8); OffSet := False; End else Begin MoveTo(X+7,Y-8); OffSet := True; End; DrawNumber(Temp); SetPrecision(3); End; End; End; SetCounter(i); ShowResults; End;