Home > Community > Forums > Custom IC SKILL > problem passing waveforms as function arguments

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: *

 problem passing waveforms as function arguments 

Last post Fri, Jan 18 2013 6:54 AM by Steve Mikes. 3 replies.
Started by Steve Mikes 17 Jan 2013 01:09 PM. Topic has 3 replies and 664 views
Page 1 of 1 (4 items)
Sort Posts:
  • Thu, Jan 17 2013 1:09 PM

    problem passing waveforms as function arguments Reply

    I'm trying to build a fuction that takes two waveform families as arguments. 

    procedure( findBestIMDs(IMDfam PAEfam)

     //function

    )

     

    I load it in the CIW and try to use it:

     

    load("./ocean/fam.ocn")
    function findBestIMDs redefined
    t
    IMD
    srrWave:0x2c3178d0
    PAE
    srrWave:0x2d0db3b0
    findBestIMDs(IMD)
    *Error* findBestIMDs: too few arguments (2 expected, 1 given) - (srrWave:0x2c3178d0)
    findBestIMDs(IMD PAE)
    *Error* findBestIMDs: too few arguments (2 expected, 1 given) - (srrWave:0x2d0db740)
    findBestIMDs(IMD PAE PAE)
    *Error* findBestIMDs: too many arguments (2 expected, 3 given) - (srrWave:0x2c3178d0 srrWave:0x2d0db3b0 srrWave:0x2d0db3b0)

     

    Why, when I provide the two wave families as arguments, does the srrWave number change and it say there's only 1?

    Thanks!

     

    • Post Points: 20
  • Fri, Jan 18 2013 12:36 AM

    • berndfi
    • Top 100 Contributor
    • Joined on Tue, Sep 11 2012
    • Neubiberg, Bavaria
    • Posts 67
    • Points 1,255
    Re: problem passing waveforms as function arguments Reply

     No one might be able to help you here since you did not provide your procedure content.

    • Post Points: 20
  • Fri, Jan 18 2013 3:26 AM

    Re: problem passing waveforms as function arguments Reply

    There's nothing special about waveform or family objects. As far as SKILL is concerned these are just variables containing a special type of object - it wouldn't treat them any differently in terms of how they are passed to the function.

    My guess is that your code has a recursive call inside (maybe using famMap?) which is only passing a single argument to the function. The first and third examples are failing (correctly) because the wrong number of arguments were being passed, and the second is passing that hurdle, but failing when the same function is recursively called.

    Of course, this is a wild guess because (as Bernd said) you didn't show your code, so it's hard to be sure.

    Regards,

    Andrew.

    • Post Points: 20
  • Fri, Jan 18 2013 6:54 AM

    Re: problem passing waveforms as function arguments Reply

     Mr. Beckett, you are the Sherlock Holmes of SKILL code.

    • Post Points: 5
Page 1 of 1 (4 items)
Sort Posts:
Started by Steve Mikes at 17 Jan 2013 01:09 PM. Topic has 3 replies.