Tony Diaz 0 Posted June 11, 2020 Share Posted June 11, 2020 I'm trying to get a field to show me: (Image Width) x (Image Height) Using a calculation for the field content I can get one or the other. Let ( a = GetContainerAttribute ( ISBN_Cover ; "width" ) ; a ) So I'm thinking something along the lines of (below) -which obviously does not work- But how do I.. Let ( a = GetContainerAttribute ( ISBN_Cover ; "width" ) ; b = GetContainerAttribute ( ISBN_Cover ; "height" ) ; a & ¶ & "x" & ¶ & a ) In the process of posting this question, it occurred to me, "the other side of the semi-colon is the output, but what about embedding another calculation in there too?" ...and that worked. So: Let ( a = GetContainerAttribute ( ISBN_Cover ; "width" ) ; Let ( b = GetContainerAttribute ( ISBN_Cover ; "height" ) ; a & ¶ & "x" & ¶ & b )) Gives me what I want. (Image Dimensions next to the image) Would there a "better" way to do this kind of thing? ... Link to post Share on other sites
comment 1,775 Posted June 11, 2020 Share Posted June 11, 2020 (edited) 25 minutes ago, Tony Diaz said: So I'm thinking something along the lines of (below) -which obviously does not work- But how do I.. Let ( a = GetContainerAttribute ( ISBN_Cover ; "width" ) ; b = GetContainerAttribute ( ISBN_Cover ; "height" ) ; a & ¶ & "x" & ¶ & a ) It doesn't work, because multiple variable assignments within the same Let statement must be enclosed in square brackets: Let ( [ a = GetContainerAttribute ( ISBN_Cover ; "width" ) ; b = GetContainerAttribute ( ISBN_Cover ; "height" ) ] ; a & ¶ & "x" & ¶ & b ) Of course, a & ¶ & "x" & ¶ & b could be shortened to: a & "¶x¶" & b or (perhaps preferably): Let ( [ w = GetContainerAttribute ( ISBN_Cover ; "width" ) ; h = GetContainerAttribute ( ISBN_Cover ; "height" ) ] ; List ( w ; "x" ; h ) ) Edited June 11, 2020 by comment Link to post Share on other sites
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now