"IF.." function

Dear Support,

Hello.

I would like to know about "IF … then … else … " function.
Many programming languages have “IF…” function.
If it exists in AnyScript, we can give the models different move or different
power according to the situation.

For example, “arm2d.any” in tutorial/StudyOfStudies,

  1. According to the angle of Elbow , “Main.ArmModel.Muscles.MusMdl.F0” changes.
  2. According to the angle of Elbow , “Main.ArmModel.Loads.Dumbbell.F” changes.

I know, when I use external text files as angles of Elbow , F0 and F, I might
be able to do it in some case.
But if “IF…” function exists, it is more convenient.

And there described about “AnyFunIf” function in AnyScript Reference Manual,
and it is “Hidden” type.
Is it possible to use ?

Thank you.

Regards,
Naoko

Hi Naoko,

The AnyFunIf can be used. Please see the reference manual for the details of
use. With this function you can for example compare values of variable and
output a certain object according to this comparison.

There is now a second type of IF statement recently implemented in the
version 3.1 of anybody. This one allows you to activate or desactivate a
whole piece of code in the model. The syntax is the following:

#define GlobalVariable 1

// the system identify Globalvariable as being equal to 1

// it can be set to 0 or whatever value to activte and disactivate the if
below

#if GlobalVariable == 1

 // here is the piece of code to be activated if true

#else

// here is the piece of code to be activated if false

#endif

This example is a simple 0 - 1 switch but it can be extended.

Best regards,

Sylvain, AnyBody Support


From: anyscript@yahoogroups.com [mailto:anyscript@yahoogroups.com] On Behalf
Of naoko.blanca
Sent: 19. marts 2009 06:49
To: anyscript@yahoogroups.com
Subject: [AnyScript] “IF…” function

Dear Support,

Hello.

I would like to know about "IF … then … else … " function.
Many programming languages have “IF…” function.
If it exists in AnyScript, we can give the models different move or
different power according to the situation.

For example, “arm2d.any” in tutorial/StudyOfStudies,

  1. According to the angle of Elbow , “Main.ArmModel.Muscles.MusMdl.F0”
    changes.
  2. According to the angle of Elbow , “Main.ArmModel.Loads.Dumbbell.F”
    changes.

I know, when I use external text files as angles of Elbow , F0 and F, I
might be able to do it in some case.
But if “IF…” function exists, it is more convenient.

And there described about “AnyFunIf” function in AnyScript Reference Manual,
and it is “Hidden” type.
Is it possible to use ?

Thank you.

Regards,
Naoko

[Non-text portions of this message have been removed]