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 / Commands over multiple lines

Author
Message
NickH
18
Years of Service
User Offline
Joined: 19th May 2008
Location: Nova Prospekt, North Yorks, UK
Posted: 8th Apr 2010 17:50 Edited at: 8th Apr 2010 17:51
Hi,

I'm still working on my game engine and its getting damn complicated to read. I know this is possible but not sure how to do it. I want to split some commands up like this simple example



Obviously I wouldn't split that simple command line up, but some of the lines of code are getting very complicated so I'd like to split them up only visually not actually effecting the command...if that makes sense

Thanks
Nick
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 8th Apr 2010 17:55
It depends which editor you use, the defaul AFAIK has no feature for continuing lines, but at least one of the alternatives, maybe even the new supplied editor supports '_'

So you might...

Position object 1,_
100,_
200,_
150

Or something like that. The underslash is the 'standard' symbol for line continuation in basic.


Health, Ammo, and bacon and eggs!
NickH
18
Years of Service
User Offline
Joined: 19th May 2008
Location: Nova Prospekt, North Yorks, UK
Posted: 8th Apr 2010 18:08
Thanks, I'm using the new TGC editor. If you go into the prefs for the IDE you can enable exactly what you said. I've been adding a feature to my game which requires a lot of changes and it won't run now, this should make it easier to debug...thanks
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 8th Apr 2010 18:18
Cool. I know what you mean, often just going back and tidying up code is the best way to find a bug, especially those damn nesting errors, its so easy to miss an endif or mis-spell a global.


Health, Ammo, and bacon and eggs!
NickH
18
Years of Service
User Offline
Joined: 19th May 2008
Location: Nova Prospekt, North Yorks, UK
Posted: 8th Apr 2010 18:39 Edited at: 8th Apr 2010 21:58
Hmmmm I'm not sure this works properly. While figuring this out I did a simple print statement split into 2, which worked fine. I`ve gone partially through my program and split some of the complicated DarkPhysics stuff up. Mainly things for setting up the joints, as it has to calculate the joint number (vehicle number, wheel number etc) then the fixing position etc. It doesn't seem to want to allow me to do this with DarkPhysics stuff. Bugger! Thats where most of the complicated..ness is

EDIT - I try and close all IFs, loops, selects cases etc before actualling filling them to stop nesting headaches, but I've changed the way all the objects and joints allocate their numbers which means I have to make a massive change in one go, thats why this is a pain

EDIT 2 - Just noticed that this isn't DarkPhysics its a bug with the 7.4 version of the editor. The first time it's used works but after that they don't work anymore
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 9th Apr 2010 11:23
That bug has probably been fixed in the U7.5 betas.
NickH
18
Years of Service
User Offline
Joined: 19th May 2008
Location: Nova Prospekt, North Yorks, UK
Posted: 9th Apr 2010 18:20
Yeah, I think I saw it on the bug list saying it had been fixed, but I'm a little suspicious of using the beta version so I think I'll wait
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 9th Apr 2010 21:56
If my personal experience is anything to go by, very long lines usually make the code awkward to read when you return to it later. So, for example, instead of something long like



perhaps break it down to something like



Matter of taste I know - but it also gives some protection against editor upgrades.
NickH
18
Years of Service
User Offline
Joined: 19th May 2008
Location: Nova Prospekt, North Yorks, UK
Posted: 10th Apr 2010 00:11
I've done that sort of thing here n there for some parts. Its mainly for some of the DarkPhysics commands that have like 8 parameters and each one (including object number) is a calculation. I've gone back to a previous save from the day before yesterday and redone yesterday's work today and it works prefectly now thank god! I put a couple of very crucial variables in uppercase so they stickout, that alone has made it more readable.

Login to post a reply

Server time is: 2026-07-26 15:31:29
Your offset time is: 2026-07-26 15:31:29