How do I check if a baseline exists for a module? When I use the function baselineExists(Module m, Baseline b), what should I pass for "b"? I mean, How do I initialize "b" at the first place when I don't know if baseline exists or not?! I don't have anything to do with minors, majors or suffix. I just have to check whether one or more baseline exists for a formal or link module.
Any help will be much appreciated. Thanks in advance. cron7 - Tue Feb 06 07:42:49 EST 2018 |
Re: Check if one or more baseline exists for a formal or link module
bool thereIsABaseline = false
Baseline b
Module m = xxx
for b in m do {
thereIsABaseline = true
break
}
Link modules or descriptive modules do not have baselines, only formal modules.
Edit: sorry, don't name your variable after a resverved keyword... |
Re: Check if one or more baseline exists for a formal or link module Mike.Scharnow - Tue Feb 06 08:01:04 EST 2018
bool thereIsABaseline = false
Baseline b
Module m = xxx
for b in m do {
thereIsABaseline = true
break
}
Link modules or descriptive modules do not have baselines, only formal modules.
Edit: sorry, don't name your variable after a resverved keyword... Thanks Mike. I'm sorry but I'm a bit new to dxl. Actually, I am passing the full name of the formal as argument and then checking if any baseline exists for that formal module in a different function. -------------
void processFormal(string mName)
//Check if baseline exists for this formal ---------------------
So, for this, how should I assign the formal module's name to 'm'?
Again, thanks for your answers. :) |
Re: Check if one or more baseline exists for a formal or link module Mike.Scharnow - Tue Feb 06 08:01:04 EST 2018
bool thereIsABaseline = false
Baseline b
Module m = xxx
for b in m do {
thereIsABaseline = true
break
}
Link modules or descriptive modules do not have baselines, only formal modules.
Edit: sorry, don't name your variable after a resverved keyword... Hi Mike, when I run your script I get the following error : "null Baseline do loop parameter was passed" |
Re: Check if one or more baseline exists for a formal or link module cron7 - Wed Feb 07 06:02:23 EST 2018 Thanks Mike. I'm sorry but I'm a bit new to dxl. Actually, I am passing the full name of the formal as argument and then checking if any baseline exists for that formal module in a different function. -------------
void processFormal(string mName)
//Check if baseline exists for this formal ---------------------
So, for this, how should I assign the formal module's name to 'm'?
Again, thanks for your answers. :) You can get a Module handle by opening a module, for your application the read-only mode is sufficient, so: Module m = read(mName, false) See the "read", "share" and "edit" functions in the DXL Reference. Or if you already have a module open, you can take that as current and modifying the above example script:
|
Re: Check if one or more baseline exists for a formal or link module PekkaMakinen - Thu Feb 08 03:17:17 EST 2018 You can get a Module handle by opening a module, for your application the read-only mode is sufficient, so: Module m = read(mName, false) See the "read", "share" and "edit" functions in the DXL Reference. Or if you already have a module open, you can take that as current and modifying the above example script:
Thanks a lot, it works. :) |