1 level

1 level: beginner


Basic operation
Write a program in anyflo language
To build applications
Using the menus
To know more

Basic operation

Download

the last anyflo version (for example anyflo.15.0) in folder anyflo_sta_eng

Run an example provided

     Click on essai.js, anyflo starts, reads the file essai.func, compiles and executes the first function essai().
This first small program written in anyflo shows the use of a very basic interaction::
       Click on box HELP which validates/invalidates the menu function HELP(), the function F5 (which is a call back called each image) displays the Help variable (initialized in the function generate_menu()) when the function HEL est active.
       Click on box EXIT executes the function EXIT() which stops the program (kill anyfloby exit).

Launch in interpreter mode

Click on anyflo_see.js: a graphical window opens full screen and a window text mode opens in it.
       A? indicates that the interpreter waits for a command line terminated by ENTER. Type exit to exit.

Or click on anyflo_video.js: a window graphic video size (768 * 576) opens and a text window which can be hidden by the first, it is appropriate to focus on it:

Focus
Simultaneously press the Alt key and the tab key, then click icon anyflo.exe, finally move it out of the window graphic area to be able to type text.

A? indicates that the interpreter waits for a command line terminated by ENTER.

To exit write exit.

A simple example of 3D

       Type:
ball(1);screen;displ vol;
The screen goes blue and ball numbered 1, radius 100 and of 3 sections y is displayed wireframe.
       Type:
ball(1)secy(8);screen;yes illum;displ vol;
The screen goes blue and ball numbered 1, radius 100 and of 3 sections y is displayed solid.

Write a program in anyflo language

       Files are changed by invoking an editor not encoding the text (Bloc-notes, Wordpad or VisualC++ editor).

First example:

essai_1.func
essai_1()
{
ball(1)secy(8);
screen;yes illum;
displ vol;
}

In the windw text type:
read func "essai_1";
Then:
essai_1();
We obtain the same effect as the command line:
ball(1)secy(8);screen;yes illum;displ vol;
Note: You can also type directly essai_1 (), since the first function of essai_1.func file has the same name, it is loaded, compiled, linked and its first function is executed.

Second example:

essai_2.func
essai_2(n)
{
if(n==NIL)n=6;
ball(1)secy(n);
screen;yes illum;
displ vol;
}

In the text window type:
read func "essai_2";
Then:
essai_2(); The ball has 6 sections y (default parameter n of essai_1 function ()).
Type:
essai_2(12);
This time the ball has 12 sections in y (n=12 parameter function essai_1 ()).
This example shows how to pass a parameter to a function.

Third example:

essai_3.func
essai_3(r,n) {
if(r==NIL)r=100;if(n==NIL)n=6;
gen_ball(r,n);
screen;yes illum;
displ vol;
}
gen_ball(r,n)
{
ball(1)dim(r)secy(n);
}

In the text window type:
read func "essai_3";
Then:
essai_3(); The ball radius r=100 (default value of parameter r) of 6 sections y (default value of parameter n) is displayed.
Type:
essai_3(200,12); The ball radius r=200 of 12 sections y is displayed.
This example shows how to write and call a function.

To build applications

     For an overview of the language see the language manual.
     A good way to learn anyflo is copy a source file to demonstrate a command com (env/demo0_com.func for words and language env/demo1_com.func for words anyflo) in the file env/vide. func and replace the name of the first function (which is demo0_com () or demo1_com ()) by vide(), then modify the code (first lightly and then adding new variables and functions), finally launch vide.js.
     A good way to build an interactive application is copy env/modele_menu_simple.func in vide.func, replace the name of the first function (which is menu_simple ()) with vide() and complete menu entries (which are AAA BBB and CCC) by a specific code. The application starts by clicking vide.js.
     View manuals for a description of objects anyflo
     View commands for a description of all commands.
     The file modele_menu_simple.func gives a basic structure to build an application with simple menus.
     The file modele_menu.func gives a basic structure to build a more complex application using submenus.
     The file modele_sous_menu.func gives a basic structure to build a more complex application using submenus.
     v modele_sous_sous_menu.func donne une structure de base pour construire une application utilisant des sous menus et des sous sous menus.
     The file modele_multi_menu.func gives a basic structure to build an application using several menus.
     One can of course mix these examples.

Using the menus

How generate menus
env/modele_menu_simple.func: Simple example of menus.
env/modele_menu.func: Menus example.
env/modele_menu_fichier.func: Menus and submenus example.
env/menu_cascade.func: Menus cascade example.

To know more

advenced.