SRL Archive - Lape

TEdit.setONKEYPRESS help


ineedbot

2014-12-01 19:07:38

Okay, so I'm working on converting my scripts over to lape, all is going good so far until now. I'm stuck, TEdit.setONKEYPRESS always crashes simba with:
Program exception! 
Stacktrace:

Exception class: EAccessViolation
Message: Access violation
$002ADBC8
$00542AD7
$0054308A
$00545572
$0040C4D6
$00541DCF
$005A1D9B
$0050767E
$7689791C
$76897B7A
$768997F4
$76899859
$0050A2F5
$0041F803
$0083411F
$0075DEC2
$00761298
Simba Version: 1100

My TEdit.setONKEYPRESS is being pointed at
procedure OnlyPostiveNumbers(Sender: TObject; var Key:Char);
begin
case toStr(key) of
#8, '0'..'9':begin
end;
else begin
Key := #0;
end;
end;
end;

This code worked fine in pS, but in lape it crashes simba…

It compiles just fine, but as soon as I input anything into the edit box, it crashes.

Ohh wait nvm, I found out that the problem was that I was doing 'setOnClick(@SomeFunc)' when in lape its just 'setOnClick(someFunc)'