• CPP + fpc = Fun times

    From Deavmi@DIGDIST/BATTLEST/FREEWAY to All on Monday, April 03, 2017 17:32:00
    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 Monday, April 03, 2017 17:34:00
    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 Monday, April 03, 2017 17:35:00
    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 Tuesday, April 04, 2017 12:38:00
    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