Hi Brian,

The "return" statement ends processing of a function, in this case your
rule.  You only get one return value.  Once the JavaScript interpreter
reaches a return statement, execution is returned to the caller and no
other code in the function gets executed, regardless of any loop in
which the return statement appears.

For instance, you can write some code like so:

  for (var i = 1; i <= 1000000000; i++)
  {
    return i;
  }

But it's not going to execute the loop a million times.  It's going to
simply return 1 and that's it.

The example you posted earlier with the document.writeln statement
obviously came from a client web page JavaScript example.  If you're
trying to return multiple graphics from the same graphic rule, that
simply isn't going to work.  A graphic rule returns a single graphic to
be used in a variable graphic frame.  If you want multiple graphics,
you're going to have to make multiple rules.

However, you could return a series of <graphic> tags which you could use
as inline graphics in a text frame.  You can concatenate values together
and store them up in another variable to return after the loop is
completed.  For example:

    var Var2=".gif"
    var Var3="bal_"
    var str= Field("fName")

    var result = "";
    for (counter = 0; counter <= str.length; counter++)
    {
      chr = str.charAt(counter)
      result += CreateResource(Var3 + chr + Var2).content;
    }

    return result;

Dan


+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
FusionPro 5.0 Now Available!


Variable text on a curve and soft drop-shadows for variable text


LIMITED TIME upgrade offer of $299 per license for current customers:
http://fusionpro.printable.com/store/upgrade

New licenses available for $599 each at:
http://fusionpro.printable.com/store/

All FusionPro 5.0 customers to receive FusionPro 5.1 with
Adobe Acrobat 8 and InDesign CS3 support when released for FREE.
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
--
Users of FusionPro Desktop have unlimited free email support. Contact Printable 
Support at [EMAIL PROTECTED]
--
View FusionPro Knowledge Base, FusionPro Samples at
www.printable.com/vdp/desktop.htm

--
You are currently subscribed to fusionpro as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
--


--
Note:  All e-mail sent to or from this address will be received or otherwise 
recorded by the e-mail recipients of this forum. It is subject to archival, 
monitoring or review by, and/or disclosure to someone other than the recipient. 
Our privacy policy is posted on www.printplanet.com
--

Reply via email to