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 / Parentheses or no parenthesis on sync?

Author
Message
CumQuaT
AGK Master
13
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 12th Oct 2017 14:36
Hi all,

So I just moved my code from one PC to another, using the same build and version of DBpro on both PCs. On the first PC, whether I write SYNC or SYNC() in my code, it compiles fine. On the second PC, it won't compile if I have the parentheses.

Given that my code has 1.97 million lines to it, and I don't want to have to find and fix every single one of them... Is there a way I can get PC 2 behaving the same as PC 1?
Help out a fellow dev! Download and rate my games! They're free!

Wizzed Off! - (Android) (iOS)
God of Thunder - (Android) (iOS)
Extreme Lawn Mowing - (Android) (iOS)

And you can get Fluffy Knuckleduster merchandise at our new store!
zero32
7
Years of Service
User Offline
Joined: 28th Jul 2016
Location:
Posted: 12th Oct 2017 14:55 Edited at: 12th Oct 2017 14:59
update dbpro on the other pc, afaik newer dbpro versions are less picky about it. or copy the dbpro folder from PC1 to PC2

sync without parentheses would be the correct way of writing it.

you can remember it like this:
if it has a return value, it needs paranteses, else it doesn't.
mouseclick has a return value, so you use mouseclick()
sync does not have a return value, so you just use sync

with the exception of user defined functions, those always use parentheses.

you could make an app that checks every command in the source file and let it show the line number of any error there might be. that would be the only solution i could think of to reliably check 1.97 million lines of code without breaking anything.
...an app like that would be neat, maybe i'll take a look....
"It is only slightly easier than changing all sugar in a cake into stevia after it has already been baked" -Bisqwit
Sedit
6
Years of Service
User Offline
Joined: 3rd Sep 2017
Location: Ghetto of NJ
Posted: 12th Oct 2017 23:24
You could always use find and replace functions, I think the editor has it but if not you could open it up into a text editor and find and replace sync() with sync.
Mage
17
Years of Service
User Offline
Joined: 3rd Feb 2007
Location: Canada
Posted: 12th Oct 2017 23:37
Quote: "Given that my code has 1.97 million lines to it, and I don't want to have to find and fix every single one of them... "

Why? How?

I need to know how does the editor handle that? Do have have to split the source code into several pieces? Are you just not reusing code properly? Lots of repeated stuff?
CumQuaT
AGK Master
13
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 13th Oct 2017 07:11
Quote: "copy the dbpro folder from PC1 to PC2"


That's what I've done


Quote: "update dbpro on the other pc"

They're both running the latest version The only reason I've done it both ways here and there is because I'm working on projects in DBPro and AppGameKit simultaneously, and each of them do it differently :\


Quote: "You could always use find and replace functions"

I can do that, but I have many commonly used functions which end in Sync, such as CountrySync(), TownSync(), etc, so a find/replace grabs them, too.


Quote: "Why? How?"

It's a very big game.


Quote: "I need to know how does the editor handle that?"

It actually didn't. The original version of DarkBASIC Pro runs out of space and won't compile the project anymore. I have to use the community built DB9Ex system to make it work at all.
Help out a fellow dev! Download and rate my games! They're free!

Wizzed Off! - (Android) (iOS)
God of Thunder - (Android) (iOS)
Extreme Lawn Mowing - (Android) (iOS)

And you can get Fluffy Knuckleduster merchandise at our new store!
CumQuaT
AGK Master
13
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 13th Oct 2017 07:11 Edited at: 13th Oct 2017 07:12
*gah, sorry. the forum broke and it did duplicate posts*
Help out a fellow dev! Download and rate my games! They're free!

Wizzed Off! - (Android) (iOS)
God of Thunder - (Android) (iOS)
Extreme Lawn Mowing - (Android) (iOS)

And you can get Fluffy Knuckleduster merchandise at our new store!
CumQuaT
AGK Master
13
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 13th Oct 2017 07:11 Edited at: 13th Oct 2017 07:12
*gah, sorry. the forum broke and it did duplicate posts*
Help out a fellow dev! Download and rate my games! They're free!

Wizzed Off! - (Android) (iOS)
God of Thunder - (Android) (iOS)
Extreme Lawn Mowing - (Android) (iOS)

And you can get Fluffy Knuckleduster merchandise at our new store!
Mage
17
Years of Service
User Offline
Joined: 3rd Feb 2007
Location: Canada
Posted: 13th Oct 2017 17:45
Well congratulations are in order. That's quite the achievement. By comparison Minecraft is only 172,712 lines of code.
Sedit
6
Years of Service
User Offline
Joined: 3rd Sep 2017
Location: Ghetto of NJ
Posted: 13th Oct 2017 19:37
You can generally set it up to find whole word only which would exclude the other variations of sync.

Login to post a reply

Server time is: 2024-03-28 13:51:04
Your offset time is: 2024-03-28 13:51:04