Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » DSDP - Real-Time Software Components (RTSC) » How to access a siblings config params?
How to access a siblings config params? [message #3945] Mon, 15 June 2009 18:27 Go to next message
Ramsey Harris is currently offline Ramsey HarrisFriend
Messages: 22
Registered: July 2009
Junior Member
Champs,

I am trying to access a module's config param from the module$use() function of another module in the same package. I'm currently using the following:

function module$use()
{
var Settings = this.$package.Settings;
if (Settings.ipc...) {
:
}
}

But in the documentation for the XDCscript Language Summary it does not recommend using this method.

pkg.ModName Module

A particular module contained within this package, unless ModName matches a name in the xdc.IPackage interface -- in this case the xdc.IPackage interface value is returned. Because of this ambiguity, this method of referencing a package's modules is deprecated.

What is the recommended way to access a siblings config params? Should I be using the following:

var Settings = xdc.useModule(this.$package.$name + '.Settings');

Or is there a better way?

Thanks
~ Ramsey
Re: How to access a siblings config params? [message #3952 is a reply to message #3945] Mon, 15 June 2009 19:20 Go to previous message
Dave Russo is currently offline Dave RussoFriend
Messages: 172
Registered: July 2009
Senior Member
Ramsey Harris wrote:
> Champs,
>
> I am trying to access a module's config param from the module$use()
> function of another module in the same package. I'm currently using the
> following:
>
> function module$use()
> {
> var Settings = this.$package.Settings;
> if (Settings.ipc...) {
> :
> }
> }
>
> But in the documentation for the XDCscript Language Summary it does not
> recommend using this method.
>
> pkg.ModName Module
>
> A particular module contained within this package, unless ModName
> matches a name in the xdc.IPackage interface -- in this case the
> xdc.IPackage interface value is returned. Because of this ambiguity,
> this method of referencing a package's modules is deprecated.
>
For what it's worth: if you follow the module naming conventions, there
will not be a name conflict.

> What is the recommended way to access a siblings config params? Should I
> be using the following:
>
> var Settings = xdc.useModule(this.$package.$name + '.Settings');
>
> Or is there a better way?
You can also use just xdc.module(). xdc.useModule() implies that the
named module will be initialized at runtime (if unless it's metaonly),
xdc.module() does not force the module to be part of the application.
>
> Thanks
> ~ Ramsey
Previous Topic:Re-throwing an error
Next Topic:RTSC Module Primer / Lesson 0+1 Examples / Windows Double-Quotes
Goto Forum:
  


Current Time: Thu Apr 25 09:18:27 GMT 2024

Powered by FUDForum. Page generated in 0.02579 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top