[prev in list] [next in list] [prev in thread] [next in thread]
List: orocos-users
Subject: [Orocos-users] How to use a uint in the scripting
From: peter.soetens () fmtc ! be (Peter Soetens)
Date: 2008-02-11 10:52:00
Message-ID: 200802111051.25345.peter.soetens () fmtc ! be
[Download RAW message or body]
On Friday 08 February 2008 16:22:44 Ruben Smits wrote:
> Hi,
>
> i would like to use a uint variable in the
> orocos-scripting/taskbrowser.
>
> But i cannot assign a value to it:
>
> var uint a = 1
>
> results in
> 0.914 [ ERROR ][Logger] cpf/states.osd :Parse error at line 7:
> Semantic error: Attempt to initialize a var uint with a int.
>
> is this a bug or do i have to assign it another way?
uint is hardly supported, the type is known, but no operations can be done
yet. I advise to use 'int' in your scripting interfaces. The only solution to
this is writing a constructor for uint which takes an int as argument, such
that you can write
var uint a = uint( -3 );
But we could also define auto-conversion rules in the scripting syntax, which
is a feature requiring more implementation work than adding the constructor.
Talking about features, another thing I miss often is the ability to define
variables in the taskbrowser prompt:
var int a = 3
[now use 'a' in taskbrowser prompt]
The variable 'a' would then be added to the interface of the current
component. Technically it is even possible to drop the 'var' prefix in the
taskbrowser.
Peter
--
Peter Soetens -- FMTC -- <http://www.fmtc.be>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic