fn: parse
[contents]

Contents

Syntax

The syntax for parse calls is:

f++:  
parse(int, string)

n++:  
@parse(int, string)

Description

The parse function is for parsing f++/n++ code multiple times, it takes an integer parameter specifying the number of times to parse followed by a string parameter to parse the number of times specified.

f++ example

Example of parse being used with f++:

  1. function(funcA)
  2. {
  3. console($[params[0]]);
  4. }
  5.  
  6. function(funcB)
  7. {
  8. write{!p}(ofile, "funcA('hello\, world')")
  9. }
  10.  
  11. parse(2, "funcB()")

n++ example

Examples of parse being used with n++:

  1. @function(funcA)
  2. {
  3. @console($[params[0]]);
  4. }
  5.  
  6. @function(funcB)
  7. {
  8. @write{!p}(ofile, "@funcA('hello\, world')")
  9. }
  10.  
  11. @parse(2, "@funcB()")

  1. @:=(string, s1="hello", s2="$[s1]", s3="$[s2]")
  2. @console("@parse(3, $[s3])")

Note that the above is slightly different to the following:

  1. @:=(string, s1="hello", s2="s1", s3="s2")
  2. @console("$[$[$[s3]]]")