Welcome! Log In Create A New Profile

Advanced

Assignment 2 Question 4

Posted by streaker 
Announcements Last Post
Announcement SoC Curricula 09/30/2017 01:08PM
Announcement Demarcation or scoping of examinations and assessment 02/13/2017 07:59AM
Announcement School of Computing Short Learning Programmes 11/24/2014 08:37AM
Announcement Unisa contact information 07/28/2011 01:28PM
Assignment 2 Question 4
June 11, 2006 05:38PM
I have a slight problem. When I select the appropriate course, the text in the label, displaying the course rating, would cut the first character off.

Pretoria becomes retoria, Centurion --> enturion etc

Any help ??

private
{ Private declarations }

procedure ShowRating (Index: integer; out CourseName, CourseRating: string);



implementation

{$R *.dfm}

procedure TfrmMyGolf.rgbCoursesClick(Sender: TObject);
var
CourseRating: string;
begin
// Change Label in Course rating
ShowRating (frmMyGolf.rgbCourses.ItemIndex, CourseName, CourseRating) ;
lblCourseRating.Caption := 'Rating for ' +CourseName+ ' is ' +CourseRating ;
end;

procedure TfrmMyGolf.ShowRating (Index: integer; out CourseName, CourseRating: string);
begin
CourseName := frmMyGolf.rgbCourses.Items.ValueFromIndex[Index];
CourseRating := IntToStr(Ratings[Index]);
Re: Assignment 2 Question 4
June 15, 2006 04:05PM
Reconmend using

frmMyGolf.rgbCourses.Items.Strings[Index]
Re: Assignment 2 Question 4
June 15, 2006 05:02PM
i used

rgbCourses.Items[rgbCourses.ItemIndex]

to get the name
Re: Assignment 2 Question 4
June 18, 2006 01:47PM
Can anyone help with assignment2 please? I am behind on chapter 8. Had some serious family problems and just discovered now that am on the due date!

email at: lote@webmail.co.za

thanks alot
avatar Re: Assignment 2 Question 4
June 18, 2006 09:06PM
African Boy,
In Tutorial 101, page 10, it states that you must submit your assignment as soon as possible and include a note of explanation.
Good luck!!
Reanie
Re: Assignment 2 Question 4
June 27, 2006 04:55PM
I had the same issue as streaker so I eventually came up with this
NOTE I have 2 lavels One for the Couse Name And One for the Rating
: this isn't neccesary - it's only cosmetic you can put the result back into One String and assign it to the lable's caption



procedure TfrmMyGolf.ShowRating(I:TRadioGroup; var S,SS:TLabel);
begin
case I.ItemIndex of
0:begin S.Caption:= I.Items.Strings[0]; SS.Caption:= IntToStr(Ratings[0]);end;
1:begin S.Caption:= I.Items.Strings[1]; SS.Caption:= IntToStr(Ratings[1]);end;
2:begin S.Caption:= I.Items.Strings[2]; SS.Caption:= IntToStr(Ratings[2]);end;
3:begin S.Caption:= I.Items.Strings[3]; SS.Caption:= IntToStr(Ratings[3]);end;
4:begin S.Caption:= I.Items.Strings[4]; SS.Caption:= IntToStr(Ratings[4]);end;
5:begin S.Caption:= I.Items.Strings[5]; SS.Caption:= IntToStr(Ratings[5]);end;
end;
//S := 'Course Rating =' + IntToStr(Ratings);
end;
Re: Assignment 2 Question 4
June 27, 2006 04:57PM
PS. here is the eventhandler for the thing


procedure TfrmMyGolf.rgbCoursesClick(Sender: TObject);
begin
ShowRating(rgbCourses,lblCourseRating,lblCR);
end;
Sorry, only registered users may post in this forum.

Click here to login