Sei sulla pagina 1di 4

5/1/2017 RandomDocuments

9
u SearchDomino
g
c
Search the TechTarget Network
s
o
i
n
Random Documents

z f
byRobert Reese

THIS ARTICLE COVERS

Domino Resources 0

+ Show More

DOWNLOAD THIS FREE GUIDE


2
Download: IT certifications that stand out
Are you looking to advance your career? Expand your knowledge? Boost your credibility? Our editors put together this complimentary 19-
page guide on everything you need to know about obtaining an IT certificationwith special attention given to cloud and desktop
certifications.

Corporate E-mail Address:

Download Now

By submitting your personal information, you agree that TechTarget and its partners may contact you regarding relevant content, products and special offers.

You also agree that your personal information may be transferred and processed in the United States, and that you have read and agree to the Terms of Use and the Privacy
Policy.

Since there has been an influx of questions on how to make exams in Lotus Notes
with random questions..I figured I'd post my random document selector.

Things to note:
'total_questions' should be filled in programatically. It should reflect the
number of documents in your doc collection or view that you are going to select
docs from.

'how_many' is the number of random documents to select

Once you have run randomizer() the outlist array will contain the document
number to use in getnthdocument.
http://searchdomino.techtarget.com/tip/RandomDocuments 1/4
5/1/2017 RandomDocuments
example usage:
forall x in outlist
doc = view.getnthdocument(x)
endforall

u--or--
cforall x in outlist
doc = collection.getnthdocument(x)
sendforall
oAny questions on this scripts can be sent to me at:
redline@thereeses.net
iCustom test dbs can also be developed.. for a price of course ;-)
Option Public
nDim tarray() As Integer
Dim outlist() As Integer
Dim total_questions As Integer
Sub Initialize
Call randomizer()
End Sub
Function randomizer()
Dim anum As Integer
Dim how_many As Integer
Dim place As Integer

' Total number of questions to choose from


total_questions% = 50
' How many do you want?
how_many% = 10
Redim outlist(0 To (how_many%-1))
'Create number array
total_questions% = total_questions% -1
Redim tarray(0 To (total_questions%))
For x = 0 To (total_questions%)
tarray(x) = x+1
Next
'Now shuffle the numbers
For place = 0 To (how_many%-1)
anum% = Round(Rnd()*total_questions%,0)
outlist(place) = tarray(anum%)
Call reorg(anum%)
Next
End Function
Function reorg(place As Integer)
Dim x As Integer
'Remove selected and slide down rest
For x = place To (total_questions%-1)
tarray(x) = tarray(x+1)
Next
'Take one from total_questions
total_questions% = total_questions% -1
Redim Preserve tarray(0 To total_questions%)
End Function

This was last published in November 2000

http://searchdomino.techtarget.com/tip/RandomDocuments 2/4
5/1/2017 RandomDocuments

m Dig Deeper on Domino Resources


ALL NEWS GET STARTED MANAGE PR OBLEM SOLVE
u 3

c
s
2 IBM to buy customer data integrator DWL

o
i2 Get your shades: Lotus looks bright again

n
2 IBM's Goyal challenges Microsoft at Lotusphere

2 Lotusphere 2005 seeks to balance presents and futures

Load More

m Start the conversation

Send me notifications when other members comment.

AddMyComment

-ADS BY GOOGLE

GartnerReportSaaSData
Protect&BackupYourSaaSAppsDataIncludingO365,GApps,SalesforceGotogo.druva.com

WINDOWS SERVER AS/400 ENTERPRISE LINUX DATA CENTER EXCHANGE CONTENT MANAGEMENT

5
SearchWindowsServer

Windows Server administrators: Take time to hone these skills

Longtime Windows Server administrators can turbocharge their careers by building expertise with these IT skills in demand today.

http://searchdomino.techtarget.com/tip/RandomDocuments 3/4
5/1/2017 RandomDocuments
Weigh Windows Server 2016 new features before committing

u
c
sAs older versions of Windows Server age, businesses will consider a Windows Server 2016 upgrade. Containers and application ...
o
i
About Us Contact Us Privacy Policy Advertisers Business Partners Media Kit Corporate Site Contributors
n
Reprints Archive Site Map Answers E-Products Events Features

Guides Opinions Photo Stories Quizzes Tips Tutorials Videos

All Rights Reserved,


Copyright 1999 - 2017, TechTarget

http://searchdomino.techtarget.com/tip/RandomDocuments 4/4

Potrebbero piacerti anche