SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 3 of 3
  1. #1
    Junior Member
    Join Date
    Dec 2005
    Location
    San Marcos, TX
    Posts
    5
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    back with end function problem

    Ok, I want to write scripts that I can use modularly. So I have three scripts that I want main to call.

    So I write (mainscript)

    function main
    include "script1"
    include "script2"
    include "script3"

    fcn_script()
    fcn_script2()
    fcn_script3()

    end function ; end main

    so in script script1

    I write
    function fcn_script
    ;
    ;
    ;
    end function

    When I compile mainscript I get the following error:

    'End Function' is missing from the function definition.

    I can copy and paste this exact code into the mainscript and it works. What am I leaving off?

  2. #2
    Junior Member
    Join Date
    Dec 2005
    Location
    San Marcos, TX
    Posts
    5
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: back with end function problem

    OK, shoot the newbie - answer found, uh-duh you dont put it in the main function.

  3. #3
    Senior Member
    Join Date
    Jan 2003
    Location
    West Bloomfield, MI
    Posts
    199
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: back with end function problem

    Put the include outside of function main...

    include "script1"
    include "script2"
    include "script3"

    function main

    fcn_script()
    fcn_script2()
    fcn_script3()

    end function ; end main

    ***************
    Also, you can have multiple functions inside of 1 "Library". Script1 could contain: fcn_script(), fcn_script2() & fcn_script3() just remember to remove the Function Main and end Main from script 1.

    Question, do you want to use the other scripts to store common functions, like a dll or do you want to run them as sub-scripts?

 

 

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 11.54%
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 01:59 PM.

Copyright BetaSoft Inc.