SPONSORS:






User Tag List

Results 1 to 10 of 10
  1. #1
    Junior Member
    Join Date
    Jul 2001
    Location
    hartford, ct, usa
    Posts
    22
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    List constructor that won\'t allow comments???

    It looks like comments are not allowed for a list of string that is implemented with the <text> format option.

    here's the code:
    [-] LIST OF String lsDataElements = <text>
    [ ] string1
    [ ] string2 // this is a comment that doesn't work
    [ ] //string3 //this comment doesn't work either


    You would think that the comments (//) would still have meaning, but hey do not...
    any ideas????

    (as usual, the documentation doesn't elaborate)

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

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

    Re: List constructor that won\'t allow comments???

    I assume what you really meant to do is:

    main ()
    list of string foo = { ... }
    "string1"
    "string2" // comment
    // another comment
    "string3"

    print ( "Foo is {foo}" )

    Which works for me ... the approach you show basically doesn't initialize the list, but does some other stuff that you probably didn't intend ...

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


    [This message has been edited by Brent Rolland (edited 10-25-2001).]

  3. #3
    Junior Member
    Join Date
    Jul 2001
    Location
    hartford, ct, usa
    Posts
    22
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: List constructor that won\'t allow comments???

    No, I wrote it correctly, it was hacked by the browser or by something else.

    Where you put the "{...}"
    I put the word "text", but it is enclosed in tags resembling HTML tags (that's why it didn't appear)

    Look at the LIST constructor in SilkHelp.
    There is an option to use this "text" option instead of {...}, so that a LIST OF STRING can be entered without using quotes:

    LIST OF STRING lsTest = text //put "text" in HTML tags
    a
    b
    c
    d

    In the list above, I don't have to put quotes around each item in the list.
    My REAL PROBLEM is that I can't use the comment tags (//) to comment out an item in the list.

    So, If anyone knows how to use the above LIST constructor and can also comment out items in the list, please let me k now.

    Thanks for your help!!


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

  4. #4
    Junior Member
    Join Date
    Oct 2001
    Location
    Calgary, AB, Canada
    Posts
    3
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: List constructor that won\'t allow comments???

    For what you refer to, the documentation says:

    For lists of string elements only. The literal characters &lt;text&gt; followed by indented lines each containing one element of the list.

    Each element is treated as the literal text of a string. Do not use quotes to indicate strings.

    4Test interprets indentation levels on the lines as tabs in the string.


    The way I read it, when you put in the comment tags, it is interpreting them as the literal text you want entered and not as comments.

    I prefer to use the following so that I can comment out items:

    list of SEARCHDATA lsQueryData = {...}
    {"wordhere"} // comments here
    // {"word2"} // commented out


  5. #5
    Junior Member
    Join Date
    Jan 2001
    Location
    Rochester, NY, USA
    Posts
    16
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: List constructor that won\'t allow comments???

    By telling Silk that you want a

    List of string MyList = <text>

    your are essentially telling four test to ignore any formatting that may appear in the following list for they are all strings. I know it is a bit of a pain to use = {...} and then add "" to all of your list items, but I have used this format many times and have no problems commented out items that I don't want to include in that run. The minimal amount of time that it would cost to place a few "" would probably out weigh the amount of time that you are expending looking for another solution with = <text>. That is unless there is some other reason why you do not want to use ={...} other than dealing with the "".

    I know it is not what you wanted to hear.

    Good luck

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

  6. #6
    Junior Member
    Join Date
    Jan 2001
    Location
    Rochester, NY, USA
    Posts
    16
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: List constructor that won\'t allow comments???

    I see that it cut out my AngleB text angleB all over the place. You should now where I mean though.

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

  7. #7
    Senior Member
    Join Date
    Jul 2001
    Location
    Elizabeth, CO, USA
    Posts
    653
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: List constructor that won\'t allow comments???

    A couple of things...

    This is why I don't use the LIST OF STRING lsNames = &lt;text&gt; type of list declaration: you can't add comments to items, you can't add comments separating sections, you can't comment-out certain items that you don't want to use. And if you accidentally add an extra space to the end of a line, you get that, too.

    JG Soft makes a good, free, text editor called EditPad that makes it easy to add quotes to the beginning and end of lines as needed. In its Replace option search for \r and replace it with "\r" to fix your list. (I'm sure there are other editors out there that do just as well. Just the one I use.)

    Additionally, read up on your HTML codes to add greater-than and less-than symbols in these posts. The ampersand (&) and lt and a semi-colon make a less-than which will appear (&lt; ) while the same with "gt" will make a greater-than symbol that appears.

    - Dave


    ------------------
    Amelior Technology
    dreed@ameliortech.com
    WaltzingRhino.com
    A concerned Borland customer, a fly in the ointment, a wrench in the works.

  8. #8
    Senior Member
    Join Date
    Jun 2000
    Location
    Chicago, IL USA
    Posts
    383
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: List constructor that won\'t allow comments???

    Another very simple trick is to turn OFF and then turn ON the "Visual 4Test" checkbox at the bottom of the Edit menu in the SilkTest editor.

    Your "text" list constuctor automatically gets converted to a "..." list constructor -- with quotes added in all the right places.

    Be careful -- the conversion can change the appearance of other code in your file -- you might want to copy/paste your block to and from a new window for conversion.

    ------------------
    Rob Kapteyn

    [This message has been edited by RobKapteyn (edited 10-26-2001).]
    Rob Kapteyn, CSTE
    RobKapteyn@gmail.com

  9. #9
    Senior Member
    Join Date
    Jul 2001
    Location
    Elizabeth, CO, USA
    Posts
    653
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: List constructor that won\'t allow comments???

    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by RobKapteyn:
    Another very simple trick is to turn OFF and then turn ON the "Visual 4Test" checkbox at the bottom of the Edit menu in the SilkTest editor.

    Your "text" list constuctor automatically gets converted to a "..." list constructor -- with quotes added in all the right places.
    <HR></BLOCKQUOTE>

    I forgot about that little trick. Good point. The danger is that it also really screws up other lists (with the {...} constructor) that have comments in them. Or it used to.

    - Dave


    ------------------
    Amelior Technology
    dreed@ameliortech.com
    WaltzingRhino.com
    A concerned Borland customer, a fly in the ointment, a wrench in the works.

  10. #10
    Junior Member
    Join Date
    Jul 2001
    Location
    hartford, ct, usa
    Posts
    22
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: List constructor that won\'t allow comments???

    Thanks all!!!

    Though the answer is "no", I appreciate the effort.
    I'll have to live with {...} like everyone else

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

 

 

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 12:41 PM.

Copyright BetaSoft Inc.