Conditional Includes?
Blitz3D Forums/Blitz3D Programming/Conditional Includes?
| ||
Is there any way to have 'conditional includes'? Blitz does not seem to acknowledge: If ProductID = 1 Include "Product1.bb" Else Include "Product2.bb" Endif - but tries to include any file on any line starting with the word 'include'. |
| ||
yes, that could come in handy indeed. In your case, isn't it possible to convert everything to functions in the include? |
| ||
No... Unless you're using Micheal Richteabisuits pre-processor. However, what you've written there will actually work in many situations. if product1.bb was print "product1" and product2.bb was print "product2" your code would read if productid = 1 print "product1" else print "Product2" endif |
| ||
No... Unless you're using Micheal Richteabisuits pre-processor. #IfDef PRODUCT1 Include "product1.bb" #Else Include "product2.bb" #EndIf Lovely thing there. That Mr. Richteabiscuit is a smart guy! |
| ||
Sounds perfect. The example is exactly what I want. I've downloaded it, and I'll let you know. |
| ||
Just a thought - if you're replacing BlitzCC.exe, what happens when they update it? |
| ||
Whoops. Have unzipped as specified, but I get a 'Abnormal Program Termination' message when I run Blitz3D.exe. And yes I did unzip with folder structure intact. Any ideas? |
| ||
You need the Microsoft .Net runtimes. |
| ||
Can you be more specific? Thanks. |
| ||
YOU NEED THE MICROSOFT .NET RUNTIMES! Tourists know that shouting usually helps get your message across. |
| ||
Sorry bout that, I'm in a cheeky mood (but then, I'm always in a cheeky mood.) I think this is what you want: http://www.asp.net/download.aspx?tabindex=0&tabid=1 |
| ||
Ha, ha. 21 megs of download on a 56k modem. I don't think so. But thanks anyway. I just have to hope that Mark adds conditional includes somewhere along the line. |
| ||
Ha, ha. 21 megs of download on a 56k modem. I don't think so. I downloaded the *SDK* version on 56k. 21 megs is nothing! |
| ||
I'm afraid I have the .NET runtimes, but I get the same error as John. Really would've liked to have a preprocessor, too :/ |
| ||
What IDE do you use? |
| ||
Well, I was testing it with the Blitz IDE, have yet to try it with ConTEXT. Ran it through ConTEXT, here's the output: > Executing: C:\Program Files\ConTEXT\ConExec.exe "C:\Program Files\Blitz3D\bin\blitzcc.exe" -q "C:\Program Files\Blitz3D\vein\h_vein.bb" Unhandled Exception: System.ComponentModel.Win32Exception: The system cannot find the file specified at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo) at System.Diagnostics.Process.Start() at Resource_Request_BlitzCC.Request(String Arguments, Boolean Console_Write) at Parameters.Decide_Parameter_Actions(Boolean Allow_Compile) at Program_Entry.Main(String[] Arguments) > Execution finished. Edit: And now it works. Don't know what happened or why it is... (I'll just blame Windows like everyone else) |