SPONSORS:






User Tag List

Results 1 to 5 of 5
  1. #1
    Senior Member
    Join Date
    Mar 2001
    Posts
    161
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Type of record data type

    User (jeffreygreen@avaya.com.nospam) posted:

    I am experiencing syntax error when I am trying to reference
    an element in a type is record declaration. Can anyone tell me
    what my problem is

    Here is my declaration

    [-] type rCompanyData is record
    [ ] STRING ssCompanyName
    [ ] STRING ssCompanyType
    [ ] STRING ssAddress1
    [ ] STRING ssAddress2
    [ ] STRING ssCity
    [ ] STRING ssState
    [ ] STRING ssIntState
    [ ] STRING ssZip
    [ ] STRING ssCountry

    And here is how I reference an element

    [ ] print("name is {rCompanyData.ssCompanyName}")


    The documentation is not too good on this area

    Thanks
    Jeff


    ------------------------ Yahoo! Groups Sponsor ---------------------~-->
    Secure your servers with 128-bit SSL encryption! Grab your copy of VeriSign's FREE Guide: "Securing Your Web Site for Business." Get it Now! http://us.click.yahoo.com/n7RbFC/zhw...gFAA/dpFolB/TM

    Post message: silktest@yahoogroups.com
    Subscribe: silktest-subscribe@yahoogroups.com
    Unsubscribe: silktest-unsubscribe@yahoogroups.com
    List owner: silktest-owner@yahoogroups.com
    URL to this page: http://groups.yahoo.com/group/silktest


    Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/



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

    Re: Type of record data type

    In the declaration you've declared a new datatype; you will need to declare an instance of that datatype before being able to reference the fields. So you want it to look something like this:



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

  3. #3
    Senior Member
    Join Date
    Mar 2001
    Posts
    161
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Type of record data type

    User (brianc@connected.com.nospam) posted:

    you should have a variable of type rCompanyData.

    rCompanyData rMyData

    print("name is {rMyData.ssCompanyName}")

    By the way, I think you may want to change your naming convention for types
    you define. We use all caps to indicate record types and then use the
    hungarian notation for the variables of that type

    e.g.
    type COMPANY_DATA is record


  4. #4
    Senior Member
    Join Date
    Mar 2001
    Posts
    161
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Type of record data type

    User Green, Jeffrey (Jeffrey) (jeffreygreen@avaya.com.nospam) posted:

    Thanks for the info as well as from brianc

    Jeff


  5. #5
    Junior Member
    Join Date
    Jul 2001
    Location
    India
    Posts
    13
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Type of record data type

    User K. Hari Prasad (khprasad@quark.stpm.soft.net.nospam) posted:

    Are u getting syntax error or compile error?
    I think u must be getting an error of ' Type mismatch -- Expecting a record
    or window" (at compile time)

    First you have to create an object of type rCompanyData before using.
    I mean u do like follows and u get it right.

    r.ssCompanyName="aaa"
    print("name is {r.ssCompanyName}")

    k.hari prasad

 

 

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:42 PM.

Copyright BetaSoft Inc.