• CPP + fpc = Fun times

    From Deavmi@DIGDIST/BATTLEST/FREEWAY to All on Mon Apr 3 17:32:00 2017
    So maybe you want to use C's pre-processor directives in FPC? Well son, I have the answer for you.

    Let's take thia Pascal code and do some CPP directives within it.

    #define progName HelloWorld
    #define msg 'Hello world'
    program progName;

    begin
    writeln(msg);
    end.

    Now we can take this file and type it in as standard input to the `cat` program and once you are done you flush that data out with a Ctrl+D.

    So here is the command set:

    cat | cpp > file.pas ; fpc file.pas

    Now this should work (provided fpc doesn't interpret the #'s that cpp outputs).

    +----+----+----+----+----+----+----+----+----+----+
    Tristan B. Kildaire (deavmi@kk4qbn.synchro.net)
    Info: `finger deavmi@kk4qbn.synchro.net` +----+----+----+----+----+----+----+----+----+----+
    ---
    Synchronet KK4QBN + (706)-422-9538 + kk4qbn.synchro.net + 24/7/365
  • From Deavmi@DIGDIST/BATTLEST/FREEWAY to Deavmi on Mon Apr 3 17:34:00 2017
    This system works flawlessly in Python as it (the Python interpreter interprets the #'s outputed by CPP as commenta - so that's fine).

    +----+----+----+----+----+----+----+----+----+----+
    Tristan B. Kildaire (deavmi@kk4qbn.synchro.net)
    Info: `finger deavmi@kk4qbn.synchro.net` +----+----+----+----+----+----+----+----+----+----+
    ---
    Synchronet KK4QBN + (706)-422-9538 + kk4qbn.synchro.net + 24/7/365
  • From Deavmi@DIGDIST/BATTLEST/FREEWAY to Deavmi on Mon Apr 3 17:35:00 2017
    I'm sorry for only testing this in Python. Lol.

    +----+----+----+----+----+----+----+----+----+----+
    Tristan B. Kildaire (deavmi@kk4qbn.synchro.net)
    Info: `finger deavmi@kk4qbn.synchro.net` +----+----+----+----+----+----+----+----+----+----+
    ---
    Synchronet KK4QBN + (706)-422-9538 + kk4qbn.synchro.net + 24/7/365
  • From Deavmi@DIGDIST/BATTLEST/FREEWAY to Deavmi on Tue Apr 4 12:38:00 2017
    I'm sorry for only testing this in Python. Lol.

    +----+----+----+----+----+----+----+----+----+----+
    Tristan B. Kildaire (deavmi@kk4qbn.synchro.net)
    Info: `finger deavmi@kk4qbn.synchro.net` +----+----+----+----+----+----+----+----+----+----+



    Nevermind. FPC interprets the # as something other than a comment. But other languages might not :).

    +----+----+----+----+----+----+----+----+----+----+
    Tristan B. Kildaire (deavmi@kk4qbn.synchro.net)
    Info: `finger deavmi@kk4qbn.synchro.net` +----+----+----+----+----+----+----+----+----+----+
    ---
    Synchronet KK4QBN + (706)-422-9538 + kk4qbn.synchro.net + 24/7/365