Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Script Problem

Status
Not open for further replies.

BenRussell

Programmer
Mar 12, 2001
243
US
I am having serious problems with one of my scripts.
is the script im having problems with.
is the source code.
I can not figure out why it is displaying $SelectedAd as some weird sequence of numbers (like 0.908109799879).

I can find NOTHING wrong with the script. I have tried this on 3 different servers and it does the same thing every time. Please help.

The problem might be in Essentials.lib (which you can see at but I dont think so.

The point of the script is to display a random advert (advertisement).
$Ad is a scalar I assigned to the foreach statement

I thought $SelectedAd = rand (@AdAccounts) would select a random value in @AdAccounts (Like $AdAccounts[0], $AdAccounts[2], etc, but assign it to @AdAccounts randomly) - Ben Russell
- President of Intracor Technologies (
 
Hi Ben,

Try to force it return as an integer, by doing
--------------------------------------------
$SelectedAd = int (rand (@AdAccounts));
--------------------------------------------

this should work, good luck~ Chiu Chan
cchan@emagine-solutions.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top