rivet Posted April 11, 2003 Posted April 11, 2003 I am creating a cdml solution that requires a random image. I have a list of theatres with related movies. When I list the theatres I want one random movie image to show beside the name.
cjaeger Posted April 11, 2003 Posted April 11, 2003 give your movie images a serial number starting at 1, step 1 for the key in the main db use an unstored calculation int(RANDOM * count(MOVIEIMG::ID))
rivet Posted April 11, 2003 Author Posted April 11, 2003 That works great, but it can result a zero. Can that be avoided?
danjacoby Posted April 11, 2003 Posted April 11, 2003 How about: (int(Random * (count(MovieImg::ID) - .5)) + .5
rivet Posted April 14, 2003 Author Posted April 14, 2003 that does not seem to work. A bracket it missing but I have tried different combinations and zero still appears.
Vaughan Posted April 14, 2003 Posted April 14, 2003 Whay not use an In-Line Action with the -FindAny tag?
danjacoby Posted April 14, 2003 Posted April 14, 2003 Wups -- I added an open parenthesis at the beginning. But there may be a problem using the "Int" function. Try this: Round((Random * (count(MovieImg::ID) - .5)) + .5, 0)
Recommended Posts
This topic is 7893 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now