Rus Eng
About company
For Software Developers
For Hardware Developers
Front page    ++ script example

The C++ script usage example

In this example C++ scripting support is embedded into the Scribble program. Scribble is a teaching example from standard Microsoft VisualStudio distributive. It lets to draw by mouse cursor in it's client window.

Let's try to write a simple script that will draw a star.
We have to include the header file scribbleapi.h that contains BeginStroke(void) (begin uninterrupted line), AddPoint(unsigned x, unsigned y) (add a polygon apex) and EndStroke(void) (end uninterrupted line) functions declared.
Star is a closed polyline. Accordingly, to draw it we need:
- to begin uninterrupted line (BeginStroke())
- to point contour apexes (they are pointed in the iteration. The first point concurs with last one)
- to finish uninterrupted line (EndStroke()).
This example compiling gives the file.

To execute this script it's needed to choose corresponding menu item and show the file that contains the compiled script.

JSC "Interstron" 1991-2010.
All rights reserved
Russia, Moscow, Dmitrovskoe shosse, 1/1
Telephone: +7 495 976-83-51
FAX: +7 495 977-60-23