Skip to content
This repository has been archived by the owner on Sep 25, 2022. It is now read-only.

Latest commit

 

History

History
138 lines (102 loc) · 2.81 KB

hello_world.md

File metadata and controls

138 lines (102 loc) · 2.81 KB

Write Hello World! in FlaScript.

What is the main() -> main?

main() -> main This code block is make a start signal from FlaScript interpreter, all codes working from here.

Example:

main() -> main {
  /> Your code here. </
} main;

Other uses:

() -> main {
  /> Your code here. </
} main;

Write Hello World!

First, FlaScript has ~3 different output option.

  • 1 - print
  • 2 - fprintf || fprintln
  • 3 - execout
  • 4 - executepp

1 - print

print is default and simply output command. This is executes C++ code.

Example:

main() -> main {
  print(string) -> "Hello World!"
} main;

Output:

Hello World!

Example 2:

main() -> main {
  print(string) -> "Hello World!"
  print(newline)
} main;

Output:

Hello World! (newline)

print supports these types.

  • 1 - string
  • 2 - string& (& = null || nil)
  • 3 - var[int]
  • 4 - int& (& = null || nil)
  • 5 - input (Under the construction)
  • 6 - last (Under the construction)
  • 7 - func
  • 8 - dynamic
  • 9 - get[] (string, int, string&, int&, env)
  • 10 - newline
  • 11 - colorized
  • 12 - rcolorized etc.

These, will be in the 'print' folder. Wait up.

2 - fprintf || fprintln

fprintf is different than print. Supports multiple text.

fprintln same with fprintf but prints newline into last line.

Example:

main() -> main {
  fprintf(<%string>[:"Hello ":, :"FlaScript!":, :" 1234567890":])
} main;

Output:

Hello FlaScript! 1234567890

Example 2:

main() -> main {
  fprintln(<%string>[:"Hello ":, :"FlaScript!":, :" 1234567890":])
} main;

Output:

Hello FlaScript! 1234567890 (newline)

fprintf and fprintln supports only string type.

3 - execout

```execout`` is based on ExecutePlusPlus library and this command is gets inputted command's output.

Example:

main() -> main {
	execout(-> echo Hello World! <-)
} main;

Output:

Hello World! (newline)

4 - executepp

executepp implementation of ExecutePlusPlus library.

Example:

main() -> main {
  executepp("ExecuteName", "whoami")
} main;

Output:

root

  • Tip: execout(-> your command here <-)

Sources:

  • 1 - fprintf
  • 2 - fprintln
  • 3 - execout
  • 4 - print_string
  • 5 - print