Welcome! Log In Create A New Profile

Advanced

Assignment 3

Posted by Anonymous User 
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
Anonymous User
Assignment 3
July 10, 2006 08:52AM
In procedure TfrmAddRound.UpdateHandicap we must determine the number of rounds on the system. How do I do that? I know its suppose to go through each record in the table and count each time the golfer played a round, but how do I wright the code for it?
Re: Assignment 3
July 12, 2006 11:53PM
hi gvs

i'm having problems with my program so i'm not that far yet to give any code but i can help you with an idea (it's how i do that type of stuff with other programming languages)

use a SQL query to get all records with the round you want to calculate together. something like "select * from round where round.golfername ='golfername goes here'". then the number of rounds played by that player will be the count of the recordset.

or alternitively you can use a loop that loops for as long as there are records (ie until end of file). within this loop you can check if the golfername field is equal to the golfer who's rounds you are interested in, and count them. basically: while there are records in the table, if golfername is 'bob' then add 1 to my counter variable, move to the next record...

hope i understood you right (and the assignment). if i did, hope it helps...

jo

Anonymous User
Re: Assignment 3
July 13, 2006 02:41PM
Thanks for the reply.
You gave me something to work with, will see what I can do tonight.
Re: Assignment 3
July 17, 2006 10:52AM
Hi,

I'm desperate for some help on this assignment...

1. How do you get the dlcGolferCloseUp function to work? This is what I have so far and has tried various options but none seem to work.

procedure TfrmAddRound.dlcGolferCloseUp(Sender: TObject);
var Golfer: String;
begin
dmoGolfAcademy.cdsRound.Close; //Close the dataset before making any changes
dmoGolfAcademy.sdsRound.CommandType := ctQuery;
dmoGolfAcademy.sdsRound.CommandText := 'SELECT * FROM round, something, something';
dmoGolfAcademy.cdsRound.Open;
dmoGolfAcademy.cdsRound.Refresh;



2. The assignment states that you must determine the number of differentials to use, the draw them into a sorted list, and then calculate the Handicap. How do you draw the selected golfer's information into a sorted list box?

Any would help would be greatly appreciated!

Regards

Stefan
Re: Assignment 3
July 17, 2006 12:49PM
try looping it.

something like:

CommandText := 'select * from round where player name = "[the player who's info you want]"

this'll give you a dataset with record from ONLY that player.

then you can loop thru the dataset and extract what you need into the sorted list
Re: Assignment 3
July 17, 2006 05:19PM
thanx

I understand what you are trying to sy but, how do I get an external text value into the SQL script?

would it look something like this?

dmoGolfAcademy.sdsround.CommandText := 'SELECT * FROM round WHERE GolferName = '[dlcGolferName.Text]'';

This does not work.... please help
Re: Assignment 3
July 17, 2006 07:36PM
OK,

I got it, you need to use "QuotedStr()";

Now how do I write a script to get the data into a list box? Nowhere can I find how to get the result of a script assigned to the items of a list box.
Sorry, only registered users may post in this forum.

Click here to login