Multiple line statements?

Blitz3D Forums/Blitz3D Beginners Area/Multiple line statements?

Who was John Galt?(Posted 2003) [#1]
Well, I'm not a newbie, but it's a simple question...

Is there any way to extend a simple command over more than one line in the editor? It would be really useful.


Ross C(Posted 2003) [#2]
how do you mean?


Who was John Galt?(Posted 2003) [#3]
e.g:
Positionentity geezer,
               <big long equation for xpos>,
               <y.................>,
               <z.................>


On multiple lines rather than one in the editor. Could make some stuff clearer.


soja(Posted 2003) [#4]
To my knowledge, there is no way to do what you want to do (at least without a pre-processor of some sort).

Blitz reads an end-of-line as the end-of-statement, and there is no "statement continuation" character (e.g. "_") that I know of.


SopiSoft(Posted 2003) [#5]
if Blitz used some sort of end-of-statement character like C/C++ and Delphi do then it would be possible...


Who was John Galt?(Posted 2003) [#6]
Alas my fear is that soja is correct, think I'll put it in as a feature request.


Agamer(Posted 2003) [#7]
o don't know if this would work but could you possibly could do it like this

a = section of code
b = a another section
c = so on
d = so on

Positionentity geezer = a+b+c+d


ok that might work or it maybe completely wrong


SopiSoft(Posted 2003) [#8]
@ Agamer: that wont work for sure!!!


SSS(Posted 2003) [#9]
that wont work but you can do something like this

xPos = <long equation>
yPos = <...>
zPos = <...>

PositionEntity geezar,xPos,yPos,zPos


Who was John Galt?(Posted 2003) [#10]
Aye I know but I wanted to avoid assigning loads of throwaway variables. I'd prefer to stick with long lines than do that.


octothorpe(Posted 2003) [#11]
Throwaway variables are great for readability! :)


Agamer(Posted 2003) [#12]
are so i gave a load of rubish advice lol


WolRon(Posted 2003) [#13]
Throwaway variables are great for readability! :)


And terrible for speed. Use less variables in speed demanding areas of your program.


octothorpe(Posted 2003) [#14]

And terrible for speed...


That entirely depends on your compiler and how much optimization it does. However, in the case of Blitz, I think you're right.


Foppy(Posted 2003) [#15]
Except if the computed value can be used more than once, but that is a special case.