Need to host a subversion repository? Try our hosted development tools.

Delphi and Kylix

Moderators: pritaeas
Number of threads: 7198
Number of posts: 18951

This Forum Only
Post New Thread

Report
Delphi Record Help Posted by ewanmc on 5 Nov 2009 at 8:56 AM
Hi, fairly new to delphi (and all) coding. Hope someone can help.
I am setting up a record type for a question:
type
  question = record
    questionNo: integer;
    questiontext: string;
    choice1: string;
    choice2: string;
    correctanswer: integer;
end;

What I am trying to do is read a question in from a memo, the line in the memo reads
1,'Scotland won the World Cup in 1998','True','False',2
How do I input this information into the data structure from a memo(or text file, thats what I'm reading into the memo in the first place?
Ideally I would have an unlimited number of questions in the memo, and I could say
q1:question;
q1(memo1.lines[0])

and q1 would store all the data in the correct place, and I could then repeat this for q2, q3 etc and change text files.

Is there an easy way to do this or do I need to rethink my plan?

Thanks,
Ewan



 
Popular resources and forums for programmers on Programmersheaven.com
Assembly, Basic, C, C#, C++, Delphi, Java, JavaScript, Pascal, Perl, PHP, Python, Ruby, Visual Basic
© Copyright 2009 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Publisher: Lars Hagelin. Read the latest words from the publisher here.
Be the first to sign up for Lars Hagelin’s In-depth Outsourcing Newsletter here.
bootstrapLabs Logo A bootstrapLabs project.