You are herefme.bas

fme.bas


By sir_mud - Posted on 10 July 2010

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
var curfile = command()
 
if curfile = "" then
        print "FreeBASIC Macro Expander Deluxe Version 1"
        print "Usage: fme [module]"
        print "[module] is the name of your file without extension."
        print "fme will automatically compile your file with -g and -r"
        print "then print the contents with macros expanded."
        print "fbc must be in your path or the local dir for this to work."
        print "Look for:"
        print " [Macro Expansion: your macro expanded here ]"
        print
        end 42
end if
 
var basfile = curfile & ".bas"
var asmfile = curfile & ".asm"
var outstr = ""
 
shell "fbc -g -r " & basfile
 
open asmfile for input as #1
 
var curline = ""
 
do while not eof(1)
        
        line input #1, curline
        curline = trim(curline)
        if left(curline,2) = "##" then outstr = outstr & curline & !"\n"
 
loop
 
close #1
 
print outstr

Post new comment

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <asm>, <bash>, <c>, <cpp>, <qt>, <csharp>, <freebasic>, <javascript>, <make>, <php>, <python>, <ruby>.
  • E-Mail addresses are hidden with reCAPTCHA Mailhide.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.