SRL Archive - OSR Help

Fixed, delete Post.


FrostFyr

2010-05-08 05:31:33

- The following code produces a Type mismatch on the last line of the InitForm procedure and i cannot find out why.

procedure RunOnce;
begin
Date:= Explode(':',NxTimeEdit1.Text);
if(pos('PM',Date[2])>0)then
begin
Date[0]:=IntToStr(StrToInt(Date[0])+12);
end;
ClearDebug;
Writeln(NxMonthCalendar1.Day);
Writeln(NxMonthCalendar1.Month);
Writeln(NxMonthCalendar1.Year);
SetArrayLength(Date,5);
Date[2]:=GetDebugLine(0);
Date[3]:=GetDebugLine(1);
Date[4]:=GetDebugLine(2);
ClearDebug;
frmDesign.ModalResult := mrOK;
end;

procedure InitForm;
begin
frmDesign := CreateForm;
frmDesign.SetBounds(250,114,184,144);
frmDesign.Visible := False;
NxMonthCalendar1 := TNxMonthCalendar.Create(frmDesign);
NxMonthCalendar1.Parent := frmDesign;
NxMonthCalendar1.SetBounds(0,0,0,0);
NxTimeEdit1 := TNxTimeEdit.Create(frmDesign);
NxTimeEdit1.Parent := frmDesign;
NxTimeEdit1.SetBounds(0,0,0,0);
Label1 := TLabel.Create(frmDesign);
Label1.Parent := frmDesign;
Label1.SetBounds(8,8,156,23);
Label1.Caption := 'Crew Tracker';
Label1.Font.Color := clBlack;
Label1.Font.Height := -21;
Label1.Font.Name := 'Courier New';
Label1.Font.Style := [fsBold];
Label2 := TLabel.Create(frmDesign);
Label2.Parent := frmDesign;
Label2.SetBounds(8,32,93,13);
Label2.Caption := 'By <name>';
Button1 := TButton.Create(frmDesign);
Button1.Parent := frmDesign;
Button1.SetBounds(8,48,153,25);
Button1.Caption := 'Start Program';
Button1.OnClick := @RunOnce;
end;

I just need scar to pull a Date and time out of its @$$ for me to manage and then i can finish the rest of it. :(

Any help will be appreciated if there are any functions that'll help me extract the exact time or anything similar (But easier than this) will be helpful :)
+ I simply forgot to add the "sender :TObject" to the procedure dumb dumb dumb :p

Sir R. M8gic1an

2010-05-08 15:08:13

When you figure something out it's better to just add a post to your thread with the solution ;) someone might have a similar difficulty soon, for which your post would've been helpful.

~RM

Sex

2010-05-08 15:15:53

From: Rasta Magician
When you figure something out it's better to just add a post to your thread with the solution ;) someone might have a similar difficulty soon, for which your post would've been helpful.

~RM

How about editing his post? Reverting it or something.

Sir R. M8gic1an

2010-05-08 15:20:29

From: Sex
How about editing his post? Reverting it or something.


That's the point of my post..

DONT REVERT.
POST ANSWER.

~RM

YoHoJo

2010-05-08 16:47:13

Reverted post back to original post.
Left answer on bottom.