Recent

Author Topic: circular unit reference  (Read 6135 times)

jw

  • Full Member
  • ***
  • Posts: 126
circular unit reference
« on: October 14, 2010, 09:51:06 pm »
How do I access variables set up in my main form unit1 from a second form unit2 without getting the circular reference error?


I have a boolean variable in my main form I need to be able to set it true or false from a button on the second form.

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: circular unit reference
« Reply #1 on: October 14, 2010, 09:54:10 pm »
Try to write a uses clause below the implementation keyword.

jw

  • Full Member
  • ***
  • Posts: 126
Re: circular unit reference
« Reply #2 on: October 14, 2010, 09:58:45 pm »
I'm terribly sorry, man your fast, I didn't search the forum well enough before posting
http://forum.lazarus.freepascal.org/index.php/topic,4015.0.html
say's what you did typo

now it appears I can access memo and such on the main form but it's telling me I it cant find the boolean var I've defined.

I'm going to try and move that boolean variable to the public and see if that helps.

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: circular unit reference
« Reply #3 on: October 14, 2010, 10:36:16 pm »
Move it to just below the Form variable, which is a global one.

 

TinyPortal © 2005-2018