Forums Anyscript.org  

Go Back   Forums Anyscript.org > Archive > AnyScript Message Archive

Notices

 
 
Thread Tools Display Modes
  #1  
Old 03-19-2009, 06:48 AM
naoko.blanca
Guest
 
Posts: n/a
Default "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

  #2  
Old 03-19-2009, 01:57 PM
AnyScript Support
Guest
 
Posts: n/a
Default RE: [AnyScript] "IF.." function

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]

 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 03:53 PM.