Quote from: fiqs on March 24, 2011, 12:23:41 amThe TfrmAdic is defined in the Unit1(TfrmAdic). Yes, in another unit. The problem is, when I try to add the Unit1 in the uses statment, I get the following error:Code: [Select]unit2.pas(9,18) Fatal: Circular unit reference between Unit2 and Unit1And when I remove the frmAdic var declaration(from the Unit2, right?) I get the following error:Code: [Select]unit2.pas(57,9) Error: Identifier not found "frmAdic"This without the Unit1 in the uses statment, because with the Unit1, I get the first error.If you want, I can post all the Units here.And about the use of Halt, you mean Application.Halt, just Halt or what?The "circular reference" is obviously a consequence of you using unit2 in unit1, so this happens when you also use unit1 in unit2. However, you must use unit1 in unit2 or you cannot call frmAdic. You can avoid the circular dependency problem if you use those units from implementation instead of interface section. That works only if you don't have declarations in the used unit that the other unit needs, but I guess you don't. So, add "uses unit1;" under the implementation keyword and see if it works ok. BTW I think it's wise to always use own units within implementation whenever you don't need their declarations. That way you avoid circular reference problems in advance.And I mean just "Halt", not "Application.Halt". It' s a procedure specifically meant for this use, to be called like that. You may also use Halt(number) if you want the program to return a value IIRC...
The TfrmAdic is defined in the Unit1(TfrmAdic). Yes, in another unit. The problem is, when I try to add the Unit1 in the uses statment, I get the following error:Code: [Select]unit2.pas(9,18) Fatal: Circular unit reference between Unit2 and Unit1And when I remove the frmAdic var declaration(from the Unit2, right?) I get the following error:Code: [Select]unit2.pas(57,9) Error: Identifier not found "frmAdic"This without the Unit1 in the uses statment, because with the Unit1, I get the first error.If you want, I can post all the Units here.And about the use of Halt, you mean Application.Halt, just Halt or what?
unit2.pas(9,18) Fatal: Circular unit reference between Unit2 and Unit1
unit2.pas(57,9) Error: Identifier not found "frmAdic"
Another question, what do you think about this radiobutton method using Form.Show? Do you know any better methods?