Book a Demo

Author Topic: printwrapped() doesn't  (Read 4303 times)

Thomas Mercer-Hursh

  • EA User
  • **
  • Posts: 386
  • Karma: +0/-0
  • Computing Integrity
    • View Profile
printwrapped() doesn't
« on: May 08, 2008, 09:35:01 am »
I suppose this might be another little EAism, but in a default component in a diagram, the name wraps.  Replacing the default with a shapescript and using

printwrapped("#name#);

I end up with a name on one line wider than the box :(

Something I don't get or bug?  7.1.827

BTW, I would happily parse the name into two pieces, but a lack of string functions makes that a little difficult.

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: printwrapped() doesn't
« Reply #1 on: May 08, 2008, 09:43:59 am »
Works for me...
Code: [Select]
shape main
{
      v_align="center";
      h_align="center";
      rectangle(0,0,100,100);
      printwrapped("#name#");
}
And it looks like this:

« Last Edit: May 08, 2008, 09:45:18 am by KP »
The Sparx Team
[email protected]

Thomas Mercer-Hursh

  • EA User
  • **
  • Posts: 386
  • Karma: +0/-0
  • Computing Integrity
    • View Profile
Re: printwrapped() doesn't
« Reply #2 on: May 08, 2008, 10:06:55 am »
Yes, I have realized that even println() wrap ... if there is a space.  It just happens that the one where I was getting the problem has no spaces!  But, this *does* wrap with the default presentation even without spaces.  So, the issue remains.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: printwrapped() doesn't
« Reply #3 on: May 08, 2008, 10:18:10 am »
I know that shape scripted elements currently don't expand to fit their contents.

But maybe it would be worth posting an example of the name that is being wrapped by the default shape (what that default shape is) and not wrapped by the shape script.

Thomas Mercer-Hursh

  • EA User
  • **
  • Posts: 386
  • Karma: +0/-0
  • Computing Integrity
    • View Profile
Re: printwrapped() doesn't
« Reply #4 on: May 08, 2008, 10:24:46 am »
A sample is:

tir/p/tir0190.p:f_valRtdDateMMYY

Funny looking, I know, but this is the name of a function called f_valRtdDateMMYY in the program tir/p/tir0190.p.  Why it is modeled as a separate component is a long story and not the issue at the moment.  The point is that this name wraps in the default appearance of Component, but not with either of the print functions in a shape script.