SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 5 of 5
  1. #1
    SQA Council
    Join Date
    Mar 2001
    Posts
    14,438
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    programmatically accessing elements of a user defined type

    User Steve Gray (sgray@BridgeMedical.com) posted:

    Is there a way to access each element in a UD Type without knowing its name?
    I have two variables of type GRIDDATA , let's call them One and Two. I want
    to look at each element in One to see if it's blank. If it is, look in Two
    and see if the matching element is not blank. If it is not blank, copy it
    to One, but I don't want to be limited by hard coding the element names.
    Any ideas?

    ---

  2. #2
    SQA Council
    Join Date
    Mar 2001
    Posts
    14,438
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: programmatically accessing elements of a user defined type

    User MArk B. (mkbutler@russellmellon.com) posted:

    I really doubt you can NOT hard code the element names. SQA Basic is a
    strong "typed" language. (whatever that means) You can't create variables at
    runtime and that's what it looks like your asking to do.

    I think what you are wanting is an array within a UD Type. Which you can't
    have either.

    MArk B.

    "Steve Gray" <sgray@BridgeMedical.com> wrote in message
    news:58783@sqa-suite-users...
    name?
    want
    Two
    ---

  3. #3
    SQA Council
    Join Date
    Mar 2001
    Posts
    14,438
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: programmatically accessing elements of a user defined type

    User Crunk John (ext3jpc) (ext3jpc@ups.com) posted:

    Can you be more specific? Are you trying to access dynamically created rows
    in a grid? Do you have a screen shot you can attach as a word document?

    John


  4. #4
    SQA Council
    Join Date
    Mar 2001
    Posts
    14,438
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: programmatically accessing elements of a user defined type

    User Schoen, Torsten 3865 PPE-QA1 (Torsten.Schoen@de.heidelberg.com) posted:

    Hi Steve,

    what you want can not be done, but you can use an array of variant to
    achieve a similar behaviour.

    So instead of:
    Type MyUDT
    sName as String
    iNumber as integer
    fValue as float
    end type

    ...

    Dim udtVar as MyUDT

    udtVar.sName = "Steve"
    ...

    you can do this:

    const udtNAME as Integer = 0
    const udtNumber as Integer = 1
    const udtValue as integer = 2

    ...

    Dim udtVar(3) as Variant

    udtVar(udtName) = "Steve"

    Not sure if you'll be satisfied with this, but SQABasic is pointerless and
    so you can't reference variables like you'd like to.


    Torsten Schoen
    PPE-QA1
    Heidelberger Druckmaschinen AG
    ---

  5. #5
    SQA Council
    Join Date
    Mar 2001
    Posts
    14,438
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: programmatically accessing elements of a user defined type

    User (Paul_Downes@providian.com) posted:


    It can't be done with UDT's, but if you replace those with Dictionary
    objects there is a way. If you are not familiar with them, Dictionary
    objects are associative arrays, similar to Collections, made available by
    the WSH. Useful creatures at times. Unlike UDT's, you can define
    "elements" at run-time and you can do the sort of "blind" comparisons of
    the arrays that you want to perform on your UDT's.

    Let me know if you need further details; I can whip up a sample.

    Cheers . . . Paul
    "Schoen, Torsten 3865 PPE-QA1" <Torsten.Schoen@de.heidelberg.com> on
    06/05/2001 06:12:39 AM

    Please respond to "SQA Suite Team Test Users"
    <sqa-suite-users@lyris.dundee.net>

    To: "SQA Suite Team Test Users" <sqa-suite-users@lyris.dundee.net>
    cc:
    Subject: RE: programmatically accessing elements of a user defined type


    Hi Steve,

    what you want can not be done, but you can use an array of variant to
    achieve a similar behaviour.

    [snipped]

    ------------------------------------------------------------------------------
    Warning : The information contained in this message may be privileged and confidential and protected from disclosure. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to this message and then delete it from your computer. All e-mail sent to this address will be received by the Providian Financial corporate e-mail system and is subject to archiving and review by someone other than the recipient.

    ================================================== ============================
    ---

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 13.64%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin 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:14 AM.

Copyright BetaSoft Inc.