× Discussions for CodeTyphon Object Pascal Programming Language

Question strange problem with a control element.

  • sabouras
  • Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
More
4 years 2 months ago #9671 by sabouras
strange problem with a control element. was created by sabouras
Dear All,
I am new in pascal and i am facing a strange problem.
I take an error from an control element. The element exists but compiler inside a function refused to see it.
Could anyone give me an advice.
Thanks in advance for your time.
Best regards to all.
Attachments:

Please Log in or Create an account to join the conversation.

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Away
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
More
4 years 2 months ago #9673 by Sternas Stefanos
Replied by Sternas Stefanos on topic strange problem with a control element.
Sir
we want more info or a sample

PilotLogic Architect and Core Programmer

Please Log in or Create an account to join the conversation.

  • sabouras
  • Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
More
4 years 2 months ago #9675 by sabouras
Replied by sabouras on topic strange problem with a control element.
Dear Mr. Stenas,
I am uploading the entire unit.
Attachments:

Please Log in or Create an account to join the conversation.

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Away
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
More
4 years 2 months ago - 4 years 2 months ago #9677 by Sternas Stefanos
Replied by Sternas Stefanos on topic strange problem with a control element.
Thanks Sir
give us time to test and report, I am alone here at PilotLogic Lab now :unsure:

PilotLogic Architect and Core Programmer
Last edit: 4 years 2 months ago by Sternas Stefanos.
The following user(s) said Thank You: sabouras

Please Log in or Create an account to join the conversation.

  • sabouras
  • Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
More
4 years 1 month ago #9681 by sabouras
Replied by sabouras on topic strange problem with a control element.
Dear Sir,
Of course i will be waiting.
Thank you for your effort.

Please Log in or Create an account to join the conversation.

More
4 years 1 month ago #9683 by Jos Wegman
Replied by Jos Wegman on topic strange problem with a control element.
Sabouras,

You declared the function Wind_Name as a forward outside the TMainForm class.
Therefor the function has no direct access to the elements of the class.
Either you declare the function within the class.

TMainForm.Wind_Name

Or you use the proper classname if you want to access the elements.
Mainform.lblWindDisplay.Visible
The following user(s) said Thank You: sabouras

Please Log in or Create an account to join the conversation.

  • sabouras
  • Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
More
4 years 1 month ago #9686 by sabouras
Replied by sabouras on topic strange problem with a control element.
Dear Mr. Wegman,
You are right about the accessing the the form elements.
But how i could make a forward declaration inside the main form?
If try to declare the function or procedure in any other place i take a lot of errors.

I am sorry if my question sound silly but i am a very new in pascal programming.

Please Log in or Create an account to join the conversation.

More
4 years 1 month ago #9688 by Jos Wegman
Replied by Jos Wegman on topic strange problem with a control element.
Sabouras,

The definition of a class starts in the interface section with
type
TMainform = class(TForm)

end ends in your case with

end;
after the public section.

So outside the class definition you can declare other functions like
your Wind_Name function.

The implementation can be done in the implementation part.
The function declared outside the class does not have the class prefix TMainForm.

So the function declared outside the class is implemented as defined in the interface section.

If this is a proper programming style is a different question. ;)
The remark about accessing form elements in my other post is still valid.


Jos

Please Log in or Create an account to join the conversation.