Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
inti2: conditional #compile "..." (named constant)
#1
In my init2 I want to do (A and B = QM function with named constants defined).
 
Code:
Copy      Help
if(FileExists(path 1)
    #compile "A"
else
    #compile "B"

Is there a way to do this?
I tried with goto, but it still attempts to process bot A and B

With goto I mean:

if(FileExists(path 1)
    goto skip A  ;; This would then skip over #compile "A"

But this does not work.

EDIT:
forgot to mention, I tried to put A and B in seperate functions, meaning create 2 functions and put only the #compile... line in those functions.
Then call the functions from init2 using if statements, but I still conflict error:
...:  previous declaration is different.  Restart QM or reopen file.
#2
Code:
Copy      Help
#if sub.FileExists
#compile sub.Good
#else
#compile sub.Bad
#endif


#sub FileExists
ret 1

#sub Good
out "good"

#sub Bad
bad
#3
Thank you!


Forum Jump:


Users browsing this thread: 1 Guest(s)