Actual code reflecting .eps not .gif
------------------------------------
var Var2=".eps"
var str= Field("fName")
var result = "";
for (counter = 0; counter <= str.length; counter++)
{
chr = str.charAt(counter)
result += CreateResource(chr + Var2).content;
}
return result;
--------------------------------------
-----Original Message-----
From: Spencer Whetstone [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 04, 2007 11:50 AM
To: FusionPro Users Forum
Subject: [fusionpro] RE: switch text to images
I have a similar need. I have a database something like this:
Fname
Spencer
John
Joe
Walter
I have 26 eps files named thus:
A.eps
B.eps
C.eps
Et cetera
I want the rule to parse each character in fname and return a string of
inline graphics within a text frame.
I am using a rule adapted from your code below:
------------------------------------
var Var2=".gif"
var str= Field("fName")
var result = "";
for (counter = 0; counter <= str.length; counter++)
{
chr = str.charAt(counter)
result += CreateResource(chr + Var2).content;
}
return result;
--------------------------------------
This fails validation with the message: line 8:Error In CreateResource(),
resource ".eps" does not exist"
Can you give me any guidance?
Spencer
-----Original Message-----
From: Dan Korn [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 25, 2007 3:59 PM
To: FusionPro Users Forum
Subject: [fusionpro] RE: switch text to images
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
--
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
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
--