Article View: comp.lang.pascal.borland
Article #600Random function - PASCAL
From: Saurabh Sinha
Date: Tue, 07 Dec 1999 00:00
Date: Tue, 07 Dec 1999 00:00
19 lines
1288 bytes
1288 bytes
Hi
I have a list of names in pascal, say:
Students = {John, Peter, Lukas, Mario, Manuel, Victory}
Could someone assist me with code to randomly select one of these names
(with no extra spaces).
What I tried:
x := random(5) + 1;
RandomName:=copy('John Peter Lukas Mario Manuel Victory', xx + pos('
','John, Peter, Lukas, Mario, Manuel, Victory'), 6);
Thanks in advance for your help. If its okay, I'd appreciate a reply to:
sinha@mweb.co.za
Saurabh
Technical Details
Message-ID:
<384c42e3.0@news1.mweb.co.za>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111659,554d55ecac19078b,start X-Google-Attributes: gid111659,public X-Google-Thread: 102601,554d55ecac19078b,start X-Google-Attributes: gid102601,public X-Google-Thread: fd1d1,554d55ecac19078b,start X-Google-Attributes: gidfd1d1,public X-Google-Thread: 10261c,554d55ecac19078b,start X-Google-Attributes: gid10261c,public From: "Saurabh Sinha" <sinha@mweb.co.za> Subject: Random function - PASCAL Date: 1999/12/07 Message-ID: <384c42e3.0@news1.mweb.co.za> X-Deja-AN: 557462486 X-Trace: 7 Dec 1999 01:12:36 +0200, pta-dial-196-2-20-89.mweb.co.za X-MSMail-Priority: Normal X-Priority: 3 Newsgroups: comp.lang.pascal.borland,comp.lang.pascal.misc,ctdl.lang.pascal,de.comp.lang.pascal X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300