Home > Community > Forums > PCB SKILL > About the axlGetParam command

Email

* Required Fields

Recipients email * (separate multiple addresses with commas)

Your name *

Your email *

Message *

Contact Us

* Required Fields
First Name *

Last Name *

Email *

Company / Institution *

Comments: *

 About the axlGetParam command 

Last post Tue, Feb 28 2006 6:31 AM by archive. 2 replies.
Started by archive 28 Feb 2006 06:31 AM. Topic has 2 replies and 1549 views
Page 1 of 1 (3 items)
Sort Posts:
  • Tue, Feb 28 2006 6:31 AM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,930
    About the axlGetParam command Reply

    I want to get the TextBlock attribute by variate.

    1. The general situation: OK

    p=axlGetParam("paramTextBlock:2")
     p->??

    =>
    (objType "paramTextBlock" width 0.584 photoWidth
        0.127 name "2" lineSpace 0.991
        height 0.787 charSpace 0.203
    )


    2.
    n=2
    p=axlGetParam("paramTextBlock:n")
    p->??
    =>(objType "paramTextBlock")

    3.
    procedure( Text(x "n")
    axlGetParam("paramTextBlock:x")
    )
    Text(2)->??

    =>(objType "paramTextBlock")

    The result of the 2nd and 3rd situation are not correct. why? how can I get it?


    Originally posted in cdnusers.org by leonlee
    • Post Points: 0
  • Tue, Feb 28 2006 7:08 AM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,930
    RE: About the axlGetParam command Reply

    The problem is that you are passing a string to the axlGetParam procedure.

    Because "x" is inside of double quotes,  you are passing a string "x" rather than the evaluation of the variable x.

    use sprintf, and I would check to make sure that x is an integer:

    procedure(Text(x)
       when(integerp(x)
          axlGetParam(sprintf(nil "paramTextBlock:%d" x))
       )
    )

    This should return the param or nil (when invalid input).


    Originally posted in cdnusers.org by natebizu
    • Post Points: 0
  • Tue, Feb 28 2006 8:26 PM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,930
    RE: About the axlGetParam command Reply

    Ok.

    It means that I can use sprintf to convert  number type to string type.

    haha, thanks.


    Originally posted in cdnusers.org by leonlee
    • Post Points: 0
Page 1 of 1 (3 items)
Sort Posts:
Started by archive at 28 Feb 2006 06:31 AM. Topic has 2 replies.