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 / Repeating Objects

Author
Message
Bozzy
18
Years of Service
User Offline
Joined: 10th Sep 2006
Location: Birmingham, UK
Posted: 17th Mar 2007 23:32
Hi there,

When I load an object once, it loads fine. However when I load it again it says Object Already Exists. I know about what happens and all, but the thing is I've had it working before using a variable. Anyway here's my code:



Cheers,
Bozzy
spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 17th Mar 2007 23:59
Defining a variable as global INSIDE a function is useless.

The line: global num=0

should be outside function, usually defined at top of program.

Your program is simply initialising num to be zero on every loop

Boo!
Bozzy
18
Years of Service
User Offline
Joined: 10th Sep 2006
Location: Birmingham, UK
Posted: 18th Mar 2007 00:11
Dont I feel silly
Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 18th Mar 2007 05:28 Edited at: 18th Mar 2007 05:29
Quote: "Defining a variable as global INSIDE a function is useless."


Really? it works for me in DBPro v6.3... Lol.

EDIT: Oh wait nevermind I see what you mean now Spooky.

Login to post a reply

Server time is: 2024-09-25 19:16:55
Your offset time is: 2024-09-25 19:16:55