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 Discussion / Difference in putting commands on the same line

Author
Message
HWT
20
Years of Service
User Offline
Joined: 1st Apr 2005
Location: Earth
Posted: 29th Nov 2005 21:51
I would be most grateful if anyone could tell me what the difference is between these 2 snippets.

The first works fine but the second doesn't.

Can anyone please explain why.

The snippet is used to restrict the angle in camera rotation



Many thanks

HelloWorld Tommorrow
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 29th Nov 2005 22:19 Edited at: 29th Nov 2005 22:21
There's only one snippet!

But assuming that's the none working one...

if cax#<-35 then cax#=-35 : if cax#>50 then cax#=50

On this line, the 'if cax#>50 then cax#=50' will only be executed if cax# is less than -35 because it will be assumed by DB to be part of the 'Then' block of code.

TDK_Man

HWT
20
Years of Service
User Offline
Joined: 1st Apr 2005
Location: Earth
Posted: 29th Nov 2005 23:10
Sorry about that little mistake

Anyway, your answer helped alot TDK_Man - thankyou kindly

HelloWorld Tommorrow

Login to post a reply

Server time is: 2025-05-22 19:28:56
Your offset time is: 2025-05-22 19:28:56