![]() Personally I would pass the four edit controls as parameters to the method: procedure TForm1.UpdateIMin_Power(R_IMax, R_IMin, R_Power, R_Volts: TEdit) Obviously you need an implementation of GetEditReferenceFromSomewhere. You need code like this: R_IMax := GetEditReferenceFromSomewhere(Range + 'IMa圎dit') You must assign object references before using them. You do not initialise these variables, but you then attempt to use methods and properties of them. You have four variables R_IMax, R_IMin, R_Power, R_Volts. R_Power.Text := FloatToStr(StrToFloat(R_IMax.Text) * StrToFloat(R_Volts.Text)) //Power = Imax * Voltage R_IMin.Text := R_IMax.Text //Let IMin = IMax IMax already manually entered by user in R1IMa圎dit Volts already on form R_IMax.Name := Range + 'IMa圎dit' //'R1IMa圎dit' when called by R1IMa圎ditChange Assign variable names to TEdit boxes already on form. ![]() Procedure TForm1.UpdateIMin_Power(Range: string) User types a new Range 1 Maximum I value procedure TForm1.R1IMa圎ditChange(Sender: TObject) Read of address 8BD88B77." Any advice would be appreciated. At run-time, I get "Access violation at address 0074CB11 in module 'MyProject.exe'. Since all the TEdit boxes have similar names, I would like to know if I can pass just the distinguishing string to a generic procedure and construct the name of the specific TEdit boxes to alter there. If the user updates the max value for any range by typing in the TEdit box, I want update the corresponding min box as well as a TEdit box that holds the product of the max times another value, etc. The data is tied to hardware that has the same min and max values for each range but several ranges.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |