Code: Select all
#define INC_LIB "../_code_lib_new_/"
'const INC_LIB = "../_code_lib_new_/"
'#include once "$(INC_LIB)graphics_v02.bi"
#include once INC_LIB ## "graphics_v02.bi"
Code: Select all
#define INC_LIB "../_code_lib_new_/"
'const INC_LIB = "../_code_lib_new_/"
'#include once "$(INC_LIB)graphics_v02.bi"
#include once INC_LIB ## "graphics_v02.bi"
Code: Select all
#define pathtobi "C:\Users\User\Desktop\New folder\fbgfx.bi"
#include pathtobi
screenres 400,400,32,,fb.GFX_ALPHA_PRIMITIVES
circle(100,100),100,rgba(200,0,0,100),,,,f
circle(200,100),100,rgba(200,0,0,100),,,,f
sleep
sleep
Code: Select all
#include once "../_code_lib_new_/graphics_v02.bi"
#include once "../_code_lib_new_/keyboard_v01.bi"
#include once "../_code_lib_new_/image_v02.bi"
#include once "../_code_lib_new_/image_buffer_v01.bi"
#include once "../_code_lib_new_/string_v01.bi"
#include once "../_code_lib_new_/int2d_v02.bi"
#include once "../_code_lib_new_/sgl2d_v02.bi"
#include once "../_code_lib_new_/event_timer_v01.bi"
#include once "../_code_lib_new_/loop_timer_v01.bi"
#include once "../_code_lib_new_/int2d_sgl2d_v01.bi"
#include once "inc_game/image_enum.bi"
Code: Select all
#Define INC_LIB "..\_
'#Define INC_LIB "_
#Include Once INC_LIB code_lib_new_\graphics_v02.bi"
Code: Select all
'' We need this to force the preprocessor to evaluate the expressions
#define __str__( a ) _
#a
#define __conc__( a, b ) _
##a##b
#define __inc__( p, f ) _
__str__( __conc__( p, f ) )
#macro __include__( p, f ) _
#include once __inc__( p, f )
#endmacro
/'
No quotes, since they'll screw the parser up. Also, note that file names
that contain spaces also work without issues.
'/
#define INCLUDE_PATH _
bi/
__include__( INCLUDE_PATH, thread.bi )
__include__( INCLUDE_PATH, brain fart.bi )
Code: Select all
#define path "C:\Users\User\Desktop\New folder
#include path\fbgfx.bi"
#include path\document.bi"
using fb
sleep
That indeed works and is the most simply solution.dodicat wrote:You could simply define your path as the folder without the end quote.
and put the end quote at the end of #include.
Indeed. As you've probably noticed, it's the quotes that wreak havok on the preprocessor. Mine implements what marcov suggested a few posts above (in fact we cross-posted). But I'd say you should go for the simplest thing that works, looks aren't everything ;)badidea wrote:That indeed works and is the most simply solution.dodicat wrote:You could simply define your path as the folder without the end quote.
and put the end quote at the end of #include.
The only problem is that it looks ugly. Especially because met editor highlighter gets confused.
Paul doe's version works as well, but also not winning the beauty contest :-)
Code: Select all
#Define INC_LIB "..\_code_lib_new_
#Include Once INC_LIB\graphics_v02.bi"
Code: Select all
#Define INC_LIB "..\_code_lib_new_\
#Include Once INC_LIBgraphics_v02.bi"
Code: Select all
#macro test(x)
#if typeof(x)=double
print "Double"
#elseif typeof(x)=single
print "single"
#elseif typeof(x)=integer
print "Integer"
#elseif typeof(x)=string
print "String"
#endif
print
#endmacro
dim as long k
do
locate 5
print "Press 1 = double"
print "Press 2 = single"
print "Press 3 = integer"
print "Press 4 = string"
print
print
do
if inkey=chr(27) then end
k=vallng(input(1))
loop until k>0 and k<5
cls
select case k
case 1
test(1#)
case 2
test(1!)
case 3
test(1)
case 4
test(time)
end select
loop
Code: Select all
dim as long k
do
locate 5
print "Press 1 = double"
print "Press 2 = single"
print "Press 3 = integer"
print "Press 4 = string"
print
print
do
if inkey=chr(27) then end
k=vallng(input(1))
loop until k>0 and k<5
cls
select case k
case 1
print "Double"
print
case 2
print "single"
print
case 3
print "Integer"
print
case 4
print "String"
print
end select
loop