Click to See Complete Forum and Search --> : javascript print


handong888
05-24-2004, 09:35 AM
Is the following code is an example of Javascrpt
while $x <= 100
do print "Project Page $x now printing"
do exec(lp -P Bib_Laser < doc.$x)
do $x = $x + 1
next

if the Javascript code, How many documents would have been printed by the previous command?
thank you

David Harrison
05-24-2004, 09:49 AM
Well that's not JavaScript code, it looks like some freakish cross between PHP and ASP (which are both server-side languages).

Anyway, it all depends on what the initial value of $x is, assuming that it starts at 0 then 101 copies would be printed, if it started at 50 then 51 copies would be printed and so on.

Number of copies printed = 101 - initial value of $x