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.

DarkBASIC Professional Discussion / Function name duplicated error

Author
Message
Unseen Ghost
23
Years of Service
User Offline
Joined: 2nd Sep 2002
Location: Ohio
Posted: 16th Jan 2021 21:14 Edited at: 16th Jan 2021 23:01
My function is as the following:




Edited: I changed the top line of code because it was saying to create the directory even if it existed. Now it will create it if it doesn't exist.

The error I am getting is shown in the image I have uploaded.
I can 't figure out why
Gigabyte Board/2.93Ghtz Intel Core Duo Proc./4GB Ram/Nvidia Geforce 730 2GB/1TB Western Dig. SSD/Dark Basic Pro 7.7

No one cares how much you know until they know how much you care.

Attachments

Scorpyo
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 17th Jan 2021 07:16
Don't know what that error is but you have a space before .txt in the 3rd line
Unseen Ghost
23
Years of Service
User Offline
Joined: 2nd Sep 2002
Location: Ohio
Posted: 17th Jan 2021 18:07
Quote: "Don't know what that error is but you have a space before .txt in the 3rd line"


Thank you for pointing that out Scorpyo, I have gotten rid of the space there.

Last night I upgraded to the DBPro 9Ex because my code is quite extensive and has a lot of #Include files. I read about the 9Ex version and it mentioned that it corrects the crashing of large code programs and programs with a lot of #Include files among other improvements. It seems to be getting a more logical error and I can probably figure out the reason for the error in my code now. Now I'm getting the following error lol:

User function 'StartLog' must return a value if used in an expression at line 102.
Gigabyte Board/2.93Ghtz Intel Core Duo Proc./4GB Ram/Nvidia Geforce 730 2GB/1TB Western Dig. SSD/Dark Basic Pro 7.7

No one cares how much you know until they know how much you care.
Raven
21
Years of Service
User Offline
Joined: 23rd Mar 2005
Location: Hertfordshire, England
Posted: 18th Jan 2021 20:39


There were some errors in your code...
Now as a note, I don't know what the Global Values you're using to keep the FileID and FileOffset are; or why when you're opening to read you even need said offset., where-as open to write this would make sense as you'd want to continue the log at the end of the existing file.
That should solve the immediate issues with the function; but it still seems a little odd in how it's written (at least to me).

I'm not sure what information / how you're logging info though... so without that I can't really write a replacement.
In any case from the errors it seems like you have 2 References to "StartLog" (be that as variables or functions) ... so checking your include file for more than one instance might be a good idea.

Login to post a reply

Server time is: 2026-06-05 09:33:47
Your offset time is: 2026-06-05 09:33:47