SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 7 of 7
  1. #1
    Senior Member
    Join Date
    Jul 2002
    Location
    delhi
    Posts
    184
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    record declaration

    If I declare any record inside a function, Silk throws syntax error, but the same declartion compiles successfully if put outside the function...

    e,g the code below compiles successfully

    </font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">[-] type EMMPLOYEE is record
    [ ] string sName
    [ ]
    [-] main ()</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">but this one renders syntax error

    </font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">[-] main ()
    [-] type EMMPLOYEE is record
    [ ] string sName</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">Is it so that we can't declare records local to any function?

  2. #2
    Senior Member
    Join Date
    Feb 2003
    Location
    Romania
    Posts
    163
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: record declaration

    Hi Masiha,

    Yes, can't declare records local to any function; more, no type...is enum declaration, type...is set declaration...

    With regards,
    nelumoldovan49

  3. #3
    Advanced Member
    Join Date
    Oct 1999
    Location
    Chicago, IL
    Posts
    652
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: record declaration

    Yep, right from the help page...

    Note Data 'type' declarations must appear outside of any function.

  4. #4
    Senior Member
    Join Date
    Jul 2002
    Location
    delhi
    Posts
    184
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: record declaration

    Thank you very much nelumoldovan49 and Brian....Any specific reason for this???

  5. #5
    Advanced Member
    Join Date
    Oct 1999
    Location
    Chicago, IL
    Posts
    652
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: record declaration

    No idea... My only guess is that datatypes are more of a "global" lower-level concept, so it didn't make sense to have individual types declared inside a function where other functions/methods could not take advantage of using it.

  6. #6
    Senior Member
    Join Date
    Jul 2002
    Location
    delhi
    Posts
    184
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: record declaration

    Thanks for sharing your view...It might me correct...

  7. #7
    Senior Member
    Join Date
    Jul 1999
    Location
    Burlingame CA 94010
    Posts
    502
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: record declaration

    Brian is right on target

 

 

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 10.00%
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 04:19 PM.

Copyright BetaSoft Inc.