SRL Archive - Delphi/FPC Help and Tutorials

Undeclared Identifier Help!


Daniel

2008-04-13 02:13:45

Well here is the script, i'll be grateful if you help me :):

unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;

type
TForm1 = class(TForm)
Label1: TLabel;
Edit1: TEdit;
Label2: TLabel;
Edit2: TEdit;
Button1: TButton;
Label3: TLabel;
Label4: TLabel;
procedure DoMath;
private

public

end;

var
Form1: TForm1;

implementation

{$R *.dfm}

procedure DoMath(Sender: TObject);
var
i, c,hl, hs: Integer;
begin
hs:=StrToInt(TForm.Edit2);
hl:=StrToInt(TForm.Edit1);
c:=hs-90/99;
i:=hs/c/120+2/4*hl-72;
Label4.Caption:=IntToStr(i)+'%';
end;

end.

Thanks!

Freddy1990

2008-04-14 13:16:11

procedure TForm1.DoMath;
var
hl, hs, i: Integer;
c, e: Extended;
begin
hs := StrToInt(Form1.Edit2);
hl := StrToInt(Form1.Edit1);
c := hs - 90 / 99;
e := hs / c / 120 + 2 / 4 * hl - 72;
i := Round(e);
Label4.Caption := IntToStr(i) + '%';
end;

(You sure you know what you're doing? =/)

Daniel

2008-04-14 19:37:09

From: Freddy1990
procedure TForm1.DoMath;
var
hl, hs, i: Integer;
c, e: Extended;
begin
hs := StrToInt(Form1.Edit2);
hl := StrToInt(Form1.Edit1);
c := hs - 90 / 99;
e := hs / c / 120 + 2 / 4 * hl - 72;
i := Round(e);
Label4.Caption := IntToStr(i) + '%';
end;

Thanks.
From: Freddy1990

(You sure you know what you're doing? =/)
Nope, no idea ;)

EDIT: Ok, after trying your procedure, i got this error:
[Error] Unit1.pas(37): Incompatible types: 'String' and 'TEdit'
and this error:
[Error] Unit1.pas(38): Incompatible types: 'String' and 'TEdit'
.

Miitchyy

2008-04-17 01:43:01

  hs := StrToInt(Form1.Edit2.Text);
hl := StrToInt(Form1.Edit1.Text);

Freddy1990

2008-04-17 11:05:11

Ah, missed that, didn't really bother to open my IDE to test it anyway :p

Daniel

2008-04-17 20:23:35

From: Kevin Wolf
  hs := StrToInt(Form1.Edit2.Text);
hl := StrToInt(Form1.Edit1.Text);


Thanks Nashi!

Miitchyy

2008-04-19 00:31:33

Haha How'd you know xP

Oh my siggy XD

Daniel

2008-04-22 05:03:02

From: Kevin Wolf
Haha How'd you know xP

Oh my siggy XD


Not really your siggy. It's just on MoparIsTheBest, i saw your name had a SCAR Scripter tag next to it, and i was wondering why you aren't on SRL. So i searched and found the your members application, then you posted that Nashi was you and you liked that name better.

So i thought you'd like to be called that instead :)

Miitchyy

2008-04-22 09:55:31

Yes I would, XD
I don't like Kevin Wolf =[
I want NASHI T_T

Bobarkinator

2008-04-22 11:42:24

http://www.villavu.com/forum/showthread.php?t=17786

Try that if you haven't already, they might not change it.

Miitchyy

2008-04-22 17:51:47

I have =/

Daniel

2008-04-22 23:59:22

From: Kevin Wolf
I have =/

Then SPAM the thread mate.

Miitchyy

2008-04-23 03:42:49

Nah, I don't want to annoy them

Daniel

2008-04-23 06:13:17

From: Kevin Wolf
Nah, I don't want to annoy them

It's fun, try it. What ever you spam they'll do to your biddings.