Google グループは Usenet の新規の投稿と購読のサポートを終了しました。過去のコンテンツは引き続き閲覧できます。
Dismiss

SKILL global variables

閲覧: 1,094 回
最初の未読メッセージにスキップ

s_kou...@yahoo.com

未読、
2007/07/10 13:35:402007/07/10
To:
Hi,

Is there in SKILL something like global variable and if yes how it is
assigned?

Thanks,
Sonia

Edward

未読、
2007/07/10 23:34:332007/07/10
To:

I'm no expert, but I've been using "defvar," as in: (defvar
THEwidgetprecision 0.36)

Edward

Andrew Beckett

未読、
2007/07/11 1:24:332007/07/11
To:

No particular need to do this using defvar. In SKILL, all variables are
global unless you declare them as local (using let(), prog() etc) or they are
implicitly local (e.g. loop variables in foreach, exists, mapcar etc).

So in C syntax, just doing:

MYglobalVar=10

will do this. In LISP syntax, this would be:

(setq MYglobalVar 10)

You can use defvar, but be aware that it doesn't guarantee to make it
global - for example, if you do:

(let (a) (defVar a 10) a)

then this will return 10, and the variable a will be undefined after the code
exist. "a" already exists in the scope, and so that is what defVar binds to.

Regards,

Andrew.
--
Andrew Beckett
Senior Solution Architect
Cadence Design Systems, UK.

s_kou...@yahoo.com

未読、
2007/07/11 12:54:562007/07/11
To:
On Jul 10, 10:24 pm, Andrew Beckett <andr...@DcEaLdEeTnEcTe.HcIoSm>
wrote:

Thanks for the good explanation.

Sonia

新着メール 0 件