Splitting long lines of code

Blitz3D Forums/Blitz3D Beginners Area/Splitting long lines of code

mkg(Posted 2008) [#1]
What is the syntax for splitting a long line of code so that it's easier to read in the ide?

There must be a way but I've just spent ages searching the forums and I can't find it.


boomboom(Posted 2008) [#2]
I am not sure there is, what you probably should do is if your line is because your doing calculations inside a function param then do them before, example:
CreateWindow((graphicswidth()/2)+(MouseX()/3)+3,graphicsheight()/2)+(MouseY()/6))

etc etc

do this instead:

local wX% = (graphicswidth()/2)+(MouseX()/3)+3
local wY% = (graphicsheight()/2)+(MouseY()/6)
CreateWindow(wX,wY)


It makes it far easier to read and to debug at a later date. I usually use temporary calculation variables like this if I am doing anything more than +1 etc, as you can document them.


GfK(Posted 2008) [#3]
Print ..
    "Hello"



Beaker(Posted 2008) [#4]
gfk - that doesn't work in Blitz3D. You are thinking of BMax. :)


SLotman(Posted 2008) [#5]
I dont think B3D has this... it would be really usefull though :(


GfK(Posted 2008) [#6]
gfk - that doesn't work in Blitz3D. You are thinking of BMax.
It doesn't? Haven't used Blitz3D in years but I thought it did for some reason. :/


mkg(Posted 2008) [#7]
Think that must be Bmax - doesn't work in b3d. Thanks for the replies. Anyone else? Or is it something lacking in b3d? Bit of a pain if it is but I guess I'll live :)


andy_mc(Posted 2008) [#8]
I'd find this useful too, I post blitz3D tutorials on youtube and it's a pain putting long lines of code in because it's hard to show them on the video.

[shameless plug]
http://www.youtube.com/amcadam26
[/shameless plug]


big10p(Posted 2008) [#9]
Blit3D definately doesn't have this feature, unforunately. There's been many a time I wished it had, tho. :/


blade007(Posted 2008) [#10]
You can combine lines in B3D,
but I don't think this is what your looking for :(
[code]
string$ = "Hello World" : Print string$