Skip to main content

Param, parse instructions and launch modes

The instruction Parse allows you to split up a character string into smaller character strings

Rainbow="red orange yellow green blue indigo violet"
Parse Rainbow color1 color2 color3
tv_warn color1 // displays « red »
tv_warn color2 // displays « orange »
tv_warn color3 // displays « yellow green blue indigo violet »

Usually, each George Script begins with the Param instruction. It allows you to choose which action will have to be done by the user in order to start the script execution : drawing a circle, a segment, a rectangle ...

The script line:

Param None

...allows the George Script to be executed without waiting for an user action.

The two script lines:

Param Single
Parse result command x y button

...allows you to execute a George Script after a simple mouse click on the project window.

  • The character string "single" will be assigned to the variable called command if a point is drawn on the screen.
  • The point coordinates will be assigned to the variables x and y.
  • The button selected by the user to draw the point will be assigned to the variable called button. (1 for RMB, 0 for LMB).

With the following script lines:

Param Line
Parse result command x1 y1 x2 y2 button

...the George Script will be launched only if a segment is drawn on the project window.

  • The character string "Line" will be assigned to the variable called command if a line is drawn on the screen.
  • The coordinates of the points at the ends of the segment will be assigned to the variables x1 y1 and x2 y2 ( see opposite )
  • The button selected by the user to draw the line will be assigned to the variable called button. (1 for RMB, 0 for LMB).

With the two script lines below:

Param Circle
Parse result command x y r button

..the George Script will be launched only if a circle is drawn on the project window.

  • The character string "Circle" will be assigned to the variable called command if a circle is drawn on the screen.
  • The coordinates of the circle center will be assigned to the variables x and y.
  • The radius of the circle will be assigned to the variable r.
  • The button selected by the user to draw the circle will be assigned to the variable called button. (1 for RMB, 0 for LMB).

With the following script lines:

Param Rectangle
Parse result command x1 y1 x2 y2 button

...the George Script will be launched only if a rectangle is drawn on the project window.

  • The character string "Rectangle" will be assigned to the variable called command if a rectangle is drawn on the screen.
  • The coordinates of the points at the ends of the rectangle will be assigned to the variables x1 y1 and x2 y2 ( see opposite )
  • The button selected by the user to draw the rectangle will be assigned to the variable called button. (1 for RMB, 0 for LMB).

With the two script lines below:

Param Freehand
Parse result command x y button

...the George Script will be launched only if a freehand curve is drawn on the project window.

  • The character string "Freehand" will be assigned to the variable called command if a curve is drawn on the screen.
  • The button selected by the user to draw the curve will be assigned to the variable called button. (1 for RMB, 0 for LMB).