Can I read command line Parameters passed to LOLCODE

338 Views Asked by At

I'm using https://code.google.com/p/lolcode-dot-net/ to compile my LOLCODE.

Once I have the exe, I'd like to pass command line parameters to it. Is there some way of getting these params to the LoLcode (other than having a separate .net solution that writes it's command line parameters to a file so the Lolcode can read it.)

Here's some code

  HAI

  HOW DUZ I MAIN YR params
     VISIBLE params
  IF U SAY SO

  MAIN "I'd like this from command param"

  KTHXBYE

Edit: Updated the header, as David pointed out

1

There are 1 best solutions below

0
On BEST ANSWER

I haven't used lolcode-dot-net, but from your code it seems you're trying to simply pass a parameter to a function.

Per the LOLCODE 1.2 language specs, this is the syntax for calling a function:

I IZ <function name> [YR <expression1> [AN YR <expression2> [AN YR <expression3> ...]]] MKAY

This works on compileonline.com:

HAI 1.2

  HOW IZ I MAIN YR params
     VISIBLE params
  IF U SAY SO

  I IZ MAIN YR "I'd like this from command param" MKAY

KTHXBYE

Output:

I'd like this from command param