LoadBank() with localhost

BlitzMax Forums/BlitzMax Beginners Area/LoadBank() with localhost

Leon Brown(Posted 2007) [#1]
I've been trying to use the following code to integrate my PHP application with my Blitz game:

file=ReadFile(LoadBank("http::localhost/~myname/tools"))

If Not file RuntimeError "could not open file openfile.bmx"

While Not Eof(file)
	Print ReadLine(file)
Wend

CloseStream file


The problem is that the Apache server installed to Mac OS X is configured to use the ~ symbol to access the local host, but BlitzMax will not allow the use of the ~ symbol in LoadBank(). Does anyone know a way around this?


Leon Brown(Posted 2007) [#2]
Problem solved. I found out where the root server installation was and have installed the application to there...


SebHoll(Posted 2007) [#3]
...but BlitzMax will not allow the use of the ~ symbol in LoadBank().

The tilde (~) character is the BlitzMax escape sequence identifier. It allows you to easily add special characters to string literals such as tab (~t);new line (~n); or a speechmark (~q).

Therefore, if you want to get the actual tilde character '~' in a string literal, you will have to use '~~', which is converted by the BlitzMax compiler to a single tilde. (See the bottom of the Literals section in the BlitzMax docs, Help > Language > Literals .


Leon Brown(Posted 2007) [#4]
Thanks for that - so I can now continue to use my normal installation of the web app I've been developing. :-)