Posts: 114
Threads: 32
Joined: Dec 2019
Reputation:
1
Location: Россия
Мне нужно установить некоторые значения в полях редактирования, прежде чем показывать форму. Я делаю это:
TfmWEB.Create (Self);
TfmWEB. edEmail.Текст := 'mail@mail.ru';
TfmWEB. edThema.Текст : = ' MyThema';
TfmWEB. Show;
Компилятор возвращает ошибку:
[ошибка dcc32] unAuth. pas (60): ожидаемый идентификатор метода E2096
Как это сделать правильно?
Posts: 1,136
Threads: 37
Joined: Mar 2018
Reputation:
30
Location: Limassol, Cyprus
Im not sure if pasting altered the source but your whitespacing is wrong. Also next time please specify exactly which line is the problem as the IDE will tell you. This is an issue with Delphi syntax, not IntraWeb.
Proper spacing is below:
TfmWEB.Create (Self);
TfmWEB.edEmail.Текст := 'mail@mail.ru';
TfmWEB.edThema.Текст := 'MyThema';
TfmWEB.Show;
Posts: 114
Threads: 32
Joined: Dec 2019
Reputation:
1
Location: Россия
Compilation error on line 60 characters
59 TfmSendMailWEB.Create(Self);
60 TfmSendMailWEB.edEmail.Text := 'mail@mail.ru';
61 TfmSendMailWEB.Show;
[dcc32 Error] unAuth.pas(60): E2096 Method identifier expected
[dcc32 Error] unAuth.pas(61): E2076 This form of method call only allowed for class methods or constructor
[dcc32 Fatal Error] F2063 Could not compile used unit 'unAuth.pas'
Posts: 1,136
Threads: 37
Joined: Mar 2018
Reputation:
30
Location: Limassol, Cyprus
TfmSendMailWEB is the class name, not the instance. You need to store the instance from Create.
Are you new to Delphi?
var
xPage: TfmSendMailWEB;
begin
xPage := TfmSendMailWEB.Create(Self);
xPage.edEmail.Text := 'mail@mail.ru';
xPage.Show;
Posts: 1,136
Threads: 37
Joined: Mar 2018
Reputation:
30
Location: Limassol, Cyprus
TfmSendMailWEB.Create(Self)
should be:
TfmSendMailWEB.Create(WebApplication)
as well
Posts: 114
Threads: 32
Joined: Dec 2019
Reputation:
1
Location: Россия
Thanks for the answer. Now everything works. I'm not new to Delphi, but my knowledge of Delphi is very specific...
I'm a radio engineer by training, of course, I studied programming as part of the educational process... then it was the ALGOL language. Later, when I was already working, I became interested in programming and independently studied FORTRAN, programmed a little in MNEMONIC CODE( assembler), then CLIPPER.
Around 2000, he started writing in Delphi.
All my language learning takes place as needed. That is, it happens something like this: There is some kind of task, for its implementation it is necessary to solve certain technical issues and I study exactly what I need for this. It turns out quite effectively. Well, with a similar situation, with a question on which I have simply not encountered for all the years.... Surprisingly, but a fact. You helped me take another step in learning Delphi. Thank you again.
Posts: 1,136
Threads: 37
Joined: Mar 2018
Reputation:
30
Location: Limassol, Cyprus
Thanks for the background info, its helpful. Many of us here (including me) are self taught developers.
Posts: 114
Threads: 32
Joined: Dec 2019
Reputation:
1
Location: Россия
01-06-2021, 01:48 PM
(This post was last modified: 01-06-2021, 01:51 PM by Сергей Александрович.)
OH, YES ! The most talented programmer in the company Energia, at the time when we worked together, was a mechanical engineer by training. When I worked as the head of the plant's automated control system department, one of the best programmers was a physics engineer by training. One of my programmers was a helicopter pilot by training... So it seems that this is not the exception, but the rule ! In general, programming is probably not a specialty, it is a state of mind.
I apologize for the digression.