SPONSORS:






User Tag List

Page 1 of 2 12 LastLast
Results 1 to 10 of 17
  1. #1
    Senior Member
    Join Date
    Feb 2000
    Posts
    1,497
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Long parameter lists / ST 5.5.3

    Be careful with long records too - about 30K worth is the limit with Silk. It'll write them without complaint (as it silently chops them off) then complain mightily when you attempt to read them back in.


    John


    ------------------

  2. #2
    Member
    Join Date
    Aug 2002
    Location
    Durham, NC USA
    Posts
    60
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Long parameter lists / ST 5.5.3

    The file is a good idea, but the biggest difficulty is that I want to be able to preserve structure with the other, similar functions that we already have (and that I may or may not have written). To do that, I need to be able to pass a full parameter list from the function call.

    I don't know of any reason I shouldn't be able to do it, but that doesn't mean there isn't one. If I am not allowed to have some memory allocation of parameters, that is a very different situation from something like a buffer overflow bug in SilkTest (which I would hope might someday be fixed).

    By the way, it appears that after a certain quantity of parameters are in the calling statement the "Function is not defined." message never goes away...

    Am I totally off base here? Is this really the problem at all? It's probably not memory, but maybe stack space, or user space, or...?

    Again, thanks for any input...

    -TC
    --
    Tim Crone
    Broadcom

  3. #3
    Senior Member
    Join Date
    Feb 2000
    Posts
    1,497
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Long parameter lists / ST 5.5.3

    Let's see if you can prove that the passed data is being corrupted. Replace the suspect function locally so that you can instead print each parm on a separate line. For those parms that are obviously looooong, use a for-next loop to SubStr() print them as ~60 column lines. Then compare the output for corruption with the known input.

    John


    ------------------

  4. #4
    Member
    Join Date
    Aug 2002
    Location
    Durham, NC USA
    Posts
    60
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Long parameter lists / ST 5.5.3

    I am coding several functions for control of a remote appliance, and two of them have very long parameter lists. I am trying not to have to create a record, since that will make the next-level programmer that less happy; however, SilkTest 5.5 SP3 (under XP)exhibits strange behavior:

    (1) if the parameter list is too long, Silk will begin to run, the Agent will kick in, and then SilkTest will throw the equivalent of a Dr. Watson and close. I can reopen and continue to use SilkTest after things calm down! Agent is hung, but I can kill it from task manager. This behavior is 100% after a certain parameter list-size has been exceeded, it appears to me. (There is also an intermediate state for this, where seemingly-random errors are generated for the function before compile.)

    Anyway, I couldn't find a way around that, so I removed some parameters. Now I am seeing:
    (2) if I call a function with a long parameter list (about three lines of Silk code, separated by soft returns), SilkTest will often complain at compile that "Function is not defined." (Once I got "Function [] is not defined.", where [] was a series of high ASCII characters. The point is that there is no legitimate function name in the error message, and typically no name at all.) Anyway, the fix for this is to cut the applicable function call in main(), and paste it elsewhere in main(). Often I can press a <CR> where the call was before, paste onto it, and then delete the new line! Much of the time that works.

    I know it is possible (and quite reasonable) to create a record here, but that would make these two functions inconsistent with a variety of other functions for this interface.

    Does anyone have any ideas how I can prevent (1) and/or (2), and can anyone else confirm this behavior?

    Thanks in advance!

    Sincerely,
    Timothy Crone
    Lvl7 Systems, Inc.

    PS - I apologize if this was covered previously; I looked, but didn't see anything similar. If so, please point me in the right direction...
    --
    Tim Crone
    Broadcom

  5. #5
    Senior Member
    Join Date
    Dec 2001
    Location
    San Jose, CA
    Posts
    102
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Long parameter lists / ST 5.5.3

    Why don't you write your long parameters into a text file and pass path+filename to your function.
    Then, in your function, reconstruct the parameters.

    Michael

    ------------------

  6. #6
    Member
    Join Date
    Aug 2002
    Location
    Durham, NC USA
    Posts
    60
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Long parameter lists / ST 5.5.3

    It doesn't appear to be a corruption issue, yet. Instead, it won't 'compile', so to speak; it stops with the error <PRE>Function is not defined.</PRE> (There are two spaces between "function" and "is", my apologies for not catching it in the first post.) This is all in Partner, even before Agent is opened.

    I can't consistently call the function. However, as I said before, I can copy and paste the call and sometimes it will at least pass the compile stage, and appear to run quite normally.

    Yesterday I experimented with putting the whole thing in braces (a list), and it passed just fine, pretty consistently. I used the SizeOf function from another post, and the parameter list was only in the 2KB range. It might be a quantity of parameters wall, rather than a size of parameters wall...

    <A HREF=http://www.crone.us/longparam.txt>This test script*</A> is a sample of a call that is doing this. This is convoluted, but I don't know why it shouldn't work. For me, this call works about 50% of the time, and seems to be very dependent on where it is in the script (only whitespace changes around it, mind).

    Obviously a call as explicit as this one would be quite rare, but I'd still like to be able to do it. (I'd expect to see a lot more variables in real life, but I don't necessarily want to have to require that.)

    As always, thanks for the suggestions, and for any more you might have...

    -TC

    * Sorry to include it as a hyperlink; it was rather unmanageably long to fit the parsing of the message board software, and it made the whole post difficult to read.

    [This message has been edited by tdcrone (edited 08-28-2002).]
    --
    Tim Crone
    Broadcom

  7. #7
    Senior Member
    Join Date
    Aug 1999
    Location
    Cambridge, UK
    Posts
    470
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Long parameter lists / ST 5.5.3

    Just one piece of advice: bite the bullet and replace the long parameter list with a record. Are you seriously saving yourself effort by persisting with multiple parameters and trying to work round these deficiencies in silktest that you are exposing? In a lot of cases, I have found it worthwhile to replace even a short (five, six items) parameter list with a single record, even though this has meant rewriting every place where the function is called.

    I find the best thing about using a record as a parameter to a function, is that you can add in new parameters if your function needs to be changed, without needing to change the function definition. In this way you can code for easy backwards-compatibility. But you do have to make the awkward jump to using a single record parameter instead of a long list of simple parameters.

    ------------------

  8. #8
    Senior Member
    Join Date
    Jul 2000
    Posts
    117
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Long parameter lists / ST 5.5.3

    Where did you define your record type? One of the little "tricks" (well, OK, it's not a trick ... it's in the help ...) is that you can only define records OUTSIDE of any functions. Basically, you have to define 'em globally.

    I'm only guessing from the error message, but that looks to be the problem. It seems to be complaining that the record isn't definted (not that the variable isn't defined).


    ------------------

  9. #9
    Member
    Join Date
    Aug 2002
    Location
    Durham, NC USA
    Posts
    60
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Long parameter lists / ST 5.5.3

    Nope, the record is defined globally.

    In fact, I can often move the offending line up or down some whitespace and it works for a time or two.

    This is the same problem I was seeing before, just using a different scenario to create it.

    -TC

    PS - for future readers, I should note that the record in my file is called
    OSPFCONFIGURATION
    and you can see slight remnants of that in this particular error screen. (This record is referred to as CONFIGRECORD in my generic accounting above.) Other error screens are just as before, with either nothing or other semi-random strings, which is why I suspect it's a memory allocation problem.


    [This message has been edited by tdcrone (edited 08-28-2002).]
    --
    Tim Crone
    Broadcom

  10. #10
    Senior Member
    Join Date
    Feb 2000
    Posts
    1,497
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Long parameter lists / ST 5.5.3

    Please show us a copy of your actual source for the record OSPFCONFIGURATION. If its too long to post here delete everything between the fifth field and the next to last field.

    John


    ------------------

 

 
Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.0.9 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Questions / Answers Form provided by vBAnswers (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominatevBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 05:53 PM.

Copyright BetaSoft Inc.