Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DLL Talk / Nuclear Glory and Subroutines

Author
Message
DL187
19
Years of Service
User Offline
Joined: 14th Nov 2004
Location:
Posted: 24th Aug 2005 03:29
Hi Ive posted this question on the Ngc forum but havent gotten this problem solved and I am anxious to get working again .

Im using subroutines and Im also using functions and I keep on getting this error "Function Must Be Declared outside program nests" when I already have the functions below the subroutines. All subroutines has the Return closing statement. When I place the functions above the subroutines i get "Function Declaration 'NGC_endapp' must be outside any program nests at line 5737" I have no function by that name so im guessing this is happening because the function using ngc is being called before the dll. So my question is how do I get my subroutines working? The code is too long to post so I will give you an idea of how it is set up.



gosub section1



section1:

do

non ngc stuff here

if upkey()=1 then gosub section2

loop

return



section2:
sync on
sync 60
objects made here

ncg called here w/ all basic info

do

collisions setup

runcollisionpro()

sync
loop

return

`Ive tried putting the functions here

functions go here/ but have tried putting at begining under the gosub section1 piece

3 of the functions here contain ngc info such as collisions etc..



The code was working before I arranged it to subroutines btw

Thanks in Advance
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 24th Aug 2005 10:32
Check for more obscure stuff...

Have you included the NGC include file?

Have you got any spurious code below your functions?

Is you main source file declared properly in the project pane?

You can also look at the full code listing in a source file in DB's temp directory (sorry, don't remember the exact name). Then you can see what is at line 5737.

DL187
19
Years of Service
User Offline
Joined: 14th Nov 2004
Location:
Posted: 25th Aug 2005 00:35
My fault, somewhere between the transition of the old code and the new one i left open a for x= statement and that was the cause of the problem. Too bad it took me a while to figure that out since it would highlight other pieces of code that had nothing to do with it.

Thanks For The Help though
SoftMotion3D
AGK Developer
18
Years of Service
User Offline
Joined: 24th Aug 2005
Location: Calgary,Alberta
Posted: 25th Aug 2005 08:44
lol

when im coding i run into that problem alot. Ill have everything working smoothly and then add a new ruitine and wonder why it says some dumb error i never had anything to do with typing. And hours later i say screw it and erase all my new code....and still have the air. Then i realize hours later that i had changed a for x statement somewhere else and forgot to fill in the blanks...meanwhile my code i just wrote and errased was just fine...

common mistake for me

Login to post a reply

Server time is: 2024-05-06 01:00:04
Your offset time is: 2024-05-06 01:00:04