IMPORTANT ANNOUNCEMENT

These forums were permanently set to read-only mode on July 20, 2022. From that day onwards, no new posting or comment is allowed on the site, but the historical content remains intact and searchable.

A new location for posting questions about PlanetPress Suite is now available:

OL Learn - PlanetPress Classic (opens in new tab)

Topic Options
#41048 - 10/15/12 11:00 AM Add a statement to an Array?
Kap Offline
OL User

Registered: 10/20/10
Posts: 80
Hi
I've been trying to add a number of hyperlinks to text within a pdf.
I have seen post
http://www.objectiflune.com/forum2/ubbth...=true#Post36060

which lays out the method for achieving this which works just fine.
However I have 1 - 5 different word/link combos I would like to use but I can't pre-create text boxes manually so I was wondering if its possible to set a statement (number of lines of code) within an array value?

I've tried something as simple as
Code:

 
array[0] := 'passthrough('[ /Rect [ 0 0 '+inttostr(floattoint(&width*72))+' '+inttostr(floattoint(&height*72))+' ]')'



but I get errors about mismatched ''. Plus, I really need to get the whole statement in there not just one line.

Is this in anyway possible?


Edited by Philippe F. (10/15/12 12:31 PM)
Edit Reason: legibility

Top
#41049 - 10/15/12 12:34 PM Re: Add a statement to an Array? [Re: Kap]
Philippe F. Offline
OL Expert

Registered: 09/06/00
Posts: 1984
Loc: Objectif Lune, Montreal, Qc
You might want to take a simpler approach. Something like:
Code:

if(&myCondition1)
  passthrough('......')
elseif(&myCondition2)
  passthrough('......')

%% etc.

endif()



That should do the trick and you won't have to mess with arrays and variables inside passthroughs.
_________________________
Technical Product Manager
I don't want to achieve immortality through my work; I want to achieve immortality through not dying - Woody Allen

Top
#41053 - 10/16/12 04:19 AM Re: Add a statement to an Array? [Re: Philippe F.]
Kap Offline
OL User

Registered: 10/20/10
Posts: 80
Thanks I realized after writing it all out that my approach would have failed even if I could have got the array working.

However now I am intrigued if it is possible to store
1. multiple lines of text
2. '' within the text
of an array in Design? Or are Design arrays really only intended for a small number of text options: red car, blue bike, etc.

Top
#41063 - 10/16/12 03:44 PM Re: Add a statement to an Array? [Re: Kap]
Philippe F. Offline
OL Expert

Registered: 09/06/00
Posts: 1984
Loc: Objectif Lune, Montreal, Qc
Each array can contain thousands of elements, each of these elements can contain thousands of characters... though I wouldn't advise pushing the envelope that far because your document will dramatically slow down and consume a lot of memory.

You can, if you really want to, store multiple lines of text (i.e. lines separated with CRLF within a single array element), but then you'll run into the issue of displaying those lines in a text object (since CRLF pairs are treated as litterals rather that being interpreted as a new paragraph boundary)
_________________________
Technical Product Manager
I don't want to achieve immortality through my work; I want to achieve immortality through not dying - Woody Allen

Top