Welcome, Guest
Username: Password: Remember me
Discussions for CodeTyphon Object Pascal Programming Language
  • Page:
  • 1

TOPIC:

strange problem with a control element. 7 years 9 months ago #9671

  • sabouras
  • sabouras's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 7
  • Thank you received: 0
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.

strange problem with a control element. 7 years 9 months ago #9673

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
  • Posts: 4505
  • Thank you received: 1100
Sir
we want more info or a sample
PilotLogic Architect and Core Programmer

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

strange problem with a control element. 7 years 9 months ago #9675

  • sabouras
  • sabouras's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 7
  • Thank you received: 0
Dear Mr. Stenas,
I am uploading the entire unit.
Attachments:

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

strange problem with a control element. 7 years 9 months ago #9677

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
  • Posts: 4505
  • Thank you received: 1100
Thanks Sir
give us time to test and report, I am alone here at PilotLogic Lab now :unsure:
PilotLogic Architect and Core Programmer
The following user(s) said Thank You: sabouras

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

Last edit: by Sternas Stefanos.

strange problem with a control element. 7 years 9 months ago #9681

  • sabouras
  • sabouras's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 7
  • Thank you received: 0
Dear Sir,
Of course i will be waiting.
Thank you for your effort.

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

strange problem with a control element. 7 years 9 months ago #9683

  • Jos Wegman
  • Jos Wegman's Avatar
  • Offline
  • New Member
  • New Member
  • Posts: 8
  • Thank you received: 4
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.

strange problem with a control element. 7 years 9 months ago #9686

  • sabouras
  • sabouras's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 7
  • Thank you received: 0
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.

strange problem with a control element. 7 years 9 months ago #9688

  • Jos Wegman
  • Jos Wegman's Avatar
  • Offline
  • New Member
  • New Member
  • Posts: 8
  • Thank you received: 4
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.

  • Page:
  • 1