Graphics

 View Only
  • 1.  Scripting For Loops

    Posted 09-06-2012 15:04

    Hello,

    I have a group of text lines that I'd like to control various properties of - such as visibility or position. I'm trying to use a for loop, but I'm missing something in the syntax. Let's say I have 5 lines, named line1, line2, etc. Can I then use a for loop to set the visiblility of all lines to false?

    I was trying to use something like this:



    if text = "3" then

    for i=1 to 5

    line" & i & ".visible" = false

    next

    end if



    Xpression doesn't like that, throwing a syntax error. Anybody have a suggestion?

    Thanks!

    Brian



  • 2.  RE: Scripting For Loops

    Posted 09-06-2012 20:20
    Hi Brian,

    you would need to do something like this:



    dim textobj as xpTextObject

    dim i as integer

    for i = 1 to 5

    self.GetObjectByName("line" & i, textobj)

    textobj.visible = false

    next



    #XPression