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 / For and Next loop command Problem.

Author
Message
Takis76
19
Years of Service
User Offline
Joined: 9th Apr 2005
Location: Greece
Posted: 18th Feb 2006 00:59
Hi ,

I have a strange problem with command for loops (For and Next).

I have this function



I post the function with empty FOR and NEXT to checkup the problem
but must be a bug.

When I compile my program with this function (Means all functions
which inludes at least one For and Next)
compiler says that:

"Cannot Find structure the_function:myfoo in local declariation"

After that program runs and Crashes , and I need to press ALT+CTRL+DEL to unstuck.

But there is no struct (Data types) in my source code yet.

I have Declare my functions with Global command before.

so I cant use For and Next function in my DarkBasic Pro.

Why is this happened?
The Nerd
20
Years of Service
User Offline
Joined: 5th Jun 2004
Location: Denmark
Posted: 18th Feb 2006 01:57
You don't have to declare "myfoo".

I can compile this code without any problems:


Hope it helps

-The Nerd

Free Particle Engine for DarkBasic Pro:
http://forum.thegamecreators.com/?m=forum_view&t=60141&b=5
Chilled Programmer 420
18
Years of Service
User Offline
Joined: 24th Nov 2005
Location: NOT SAYING!, i dont wanna get kidnapped!
Posted: 21st Feb 2006 22:10
few points to note:

dbp wont run a function unless u tell it to by puttuin the functions name:
the_function()

also u declaired the "myfoo" at the top, but as what?
u need
global myfoo as integer
theres also: string, float, real, doublefloat, word, dword or somthin like them

and also to use a varible, it dont need to be declaired(though this is good practice) though thatvarible will only work in the function its in

[url=www.freewebs.com/tyhrfg][img]bruce.bmp[/img][/url]

Login to post a reply

Server time is: 2024-09-24 17:34:16
Your offset time is: 2024-09-24 17:34:16