SPONSORS:






User Tag List

Results 1 to 4 of 4
  1. #1
    Junior Member
    Join Date
    Oct 2000
    Location
    Lexington, MA USA
    Posts
    2
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Populating records

    I'm having difficulty populating my record. It is defined as:

    type HomeRec is record
    STRING sName
    STRING sStreet

    FredRec HomeRec

    FredRec.sName = "Fred" //after I press Enter, Silk puts an "x" in front of the line indicating an error. If I compile, I get a syntax error.

    How can I populate FredRec.Name?


  2. #2
    SQA Knight
    Join Date
    Jul 1999
    Location
    Grand Rapids, MI
    Posts
    3,727
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Populating records

    The following code works:

    Perhaps in your initial attempt you tried to use runtime initialization syntax outside of a function or testcase, which is not permitted. Outside of a function or testcase you must use static initializers [as shown above].

    -Terry Horwath


    [This message has been edited by Terry Horwath (edited 10-19-2000).]

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

    Re: Populating records

    I think the heart of your problem is in the line:

    FredRec HomeRec

    What this means is something like "create a variable called HomeRec of type FredRec". Of course you want it the other way around, so the line should be:

    HomeRec FredRec

    I would recommend using some concrete way of distinguishing between record types and variable names (we have all our record types named in full capitals for example, or you could use the 'r' in front of your variable name as in Terry's mail) in order to make this coding problem less likely to occur in future.

  4. #4
    Junior Member
    Join Date
    Oct 2000
    Location
    Lexington, MA USA
    Posts
    2
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Populating records

    Thanks

 

 

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:43 AM.

Copyright BetaSoft Inc.