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.

Newcomers DBPro Corner / Nesting Error

Author
Message
Xatinei
21
Years of Service
User Offline
Joined: 26th Feb 2003
Location:
Posted: 26th Feb 2003 10:00
I seem to always get a nesting error and I cant fix it. I check all my code, looks right. Could someone please tell me what it means?
Megaman Zero
21
Years of Service
User Offline
Joined: 25th Jan 2003
Location: United States
Posted: 26th Feb 2003 11:39
Try posting your code, so others may look at it, to try & figure out what you have problems with. There are millions of combos with codes, its hard to us to know, when we cant see any code.

Shadow Robert
22
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 26th Feb 2003 11:45
this means that you've not closed either
function... endfunction
while... endwhile
if... endif
do... loop
case... endcase
for... next

the editor will highlight the line which it occurs on, so reread your code carefully

i tend to get this problem (even after 4years) when i do lots of IF statements in each other, don't add the right ammount of ENDIFs

i'd suggest whenever you start something which needs to be ended - indent ( TAB ->| ) and then when you close goto the next free line and then press ( <- Backspace )

allows you to keep better tabs on if something is closed or not

Tsu'va Oni Ni Jyuuko Fiori Sei Tau!
One block follows the suit ... the whole suit of blocks is the path ... what have you found?
Zach
21
Years of Service
User Offline
Joined: 23rd Feb 2003
Location: Ms, USA
Posted: 27th Feb 2003 05:10
usually means you left off a do or loop or a part to a multi function command.

Tupelo, Ms
Dave J
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Feb 2003
Location: Secret Military Pub, Down Under
Posted: 27th Feb 2003 08:01
I usually create an EndIf Straight away and then put the code inside. For instance, I'd type:



Then go in and put the code or more if's:



Doing that I usually never forget an EndIf because you put it in straight away. It's also good to comment the EndIf's if you have lots nested or near eachother like above.

That's just my style though and a suggestion if you have lots of problems - it's something I brought over from VB which is why my only problem with If Statements is sometimes I type "End If" with a space.

"Computers are useless they can only give you answers."
actarus
22
Years of Service
User Offline
Joined: 29th Aug 2002
Location: 32 Light Years away
Posted: 27th Feb 2003 14:57
-Doing that I usually never forget an EndIf because you put it in straight away

Or if you use DarkEdit and DB Classic you can use the built-in command blocks. (ctrl-J I think)

You'll never forget that Endif again

Just remember that you're standing on a planet that's evolving
And revolving at nine hundred miles an hour!
Dave J
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Feb 2003
Location: Secret Military Pub, Down Under
Posted: 28th Feb 2003 07:08
Gah, I never knew that and I use them. All the wasted "EndIf" typing time, lol. Thanks though.

"Computers are useless they can only give you answers."
TogaMario
21
Years of Service
User Offline
Joined: 30th Jan 2003
Location:
Posted: 28th Feb 2003 08:44
Putting comments in my DBPro code like that will cause errors.

P.S. This is what the alphabet would look like if Q and R were eliminated.

Login to post a reply

Server time is: 2024-11-24 04:48:41
Your offset time is: 2024-11-24 04:48:41