Hello,
Module m = current
AttrType at = find(m, "Good or bad")
if (null at) then{
string codes[]={
"good",
"bad"}
int values[] ={0,1}
int colors[] ={realColor_Green,
realColor_Red}
string descs[]={
"This is good",
"This is bad"}
string errmess = ""
setRealColourOptionForTypes(true)
at = create("Good or bad", codes,values, colors,descs,errmess)
}
AttrDef ad = find(m,"Good or bad")
if (null ad) then{
ad = create object type "Good or bad" attribute "Good or bad"
}
// HERE!!! ------------------------------
Object o = create m
bool b = true
Skip ooo = create
if b == true then
put(ooo,o,o)
else
o . "Good or bad" = "bad"
delete ooo
if b == true then o . "Good or bad" = "good" else o . "Good or bad" = "bad"
if b == true then
put(ooo,o,o)
else{
o . "Good or bad" = "bad"
}
SystemAdmin - Wed Oct 26 04:25:38 EDT 2011 |
Re: Put in skip list causing some -E- DXL: incorrect arguments for (if) |
Re: Put in skip list causing some -E- DXL: incorrect arguments for (if)
That is really funny. It seems with that "put()" on the if statement any assignment in the else clause fails parsing ... Skip sk = create() if (true) put(sk,0,0) else sk = null
Skip sk = create()
if (true) put(sk,0,0) else { sk = null }
Skip sk = create() if (true) put(sk,0,0) else print "Hallo" sk = null
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
|
Re: Put in skip list causing some -E- DXL: incorrect arguments for (if) Mathias Mamsch - Wed Oct 26 12:50:47 EDT 2011
That is really funny. It seems with that "put()" on the if statement any assignment in the else clause fails parsing ... Skip sk = create() if (true) put(sk,0,0) else sk = null
Skip sk = create()
if (true) put(sk,0,0) else { sk = null }
Skip sk = create() if (true) put(sk,0,0) else print "Hallo" sk = null
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
if (canModify(in_obj)) // then in_obj."Interface_SE-Analyst" = NameFull else {g_CountFail++} Never got around to narrowing down the exact causes, something Telelogic always insisted I do for them before they would even consider having development reject my suggestion there was a bug. Never occurred to me it was the "then" clause, now maybe I'll pay more attention. Like putting the braces around the "then" clause and seeing if that fixes it.
|
Re: Put in skip list causing some -E- DXL: incorrect arguments for (if) llandale - Wed Oct 26 13:20:19 EDT 2011
Interestingly enough... int i = 2, j = 2 if i == j then j = 22
int i = 2, j = 2 if i == j else j = 22
|
Re: Put in skip list causing some -E- DXL: incorrect arguments for (if) Doug.Zawacki - Thu Oct 27 13:50:20 EDT 2011
Interestingly enough... int i = 2, j = 2 if i == j then j = 22
int i = 2, j = 2 if i == j else j = 22
|
Re: Put in skip list causing some -E- DXL: incorrect arguments for (if) Doug.Zawacki - Thu Oct 27 13:56:18 EDT 2011
Sorry, was reading the DXL help and my paste didn't work as expected. if (2 + 3) == 4 then print "no"
|
Re: Put in skip list causing some -E- DXL: incorrect arguments for (if) Doug.Zawacki - Thu Oct 27 14:01:04 EDT 2011
Sorry, was reading the DXL help and my paste didn't work as expected. if (2 + 3) == 4 then print "no"
Does anyone have a list of order of precendence evaluation? int a Skip sk = create() if (true) put(sk,0,0) else a = 1
Skip sk = create() if (true) put(sk,0,0) else print "Hi"
|
Re: Put in skip list causing some -E- DXL: incorrect arguments for (if) Doug.Zawacki - Thu Oct 27 14:15:30 EDT 2011
Does anyone have a list of order of precendence evaluation? int a Skip sk = create() if (true) put(sk,0,0) else a = 1
Skip sk = create() if (true) put(sk,0,0) else print "Hi"
ok. This is really messed up. I'm done looking at this... int a = 0 Skip sk = create() if (true) put(sk,0,0) else a = 1
string str = "" Skip sk = create() if (true) put(sk,0,0) else str = "x"
|
Re: Put in skip list causing some -E- DXL: incorrect arguments for (if) Doug.Zawacki - Thu Oct 27 14:37:40 EDT 2011
ok. This is really messed up. I'm done looking at this... int a = 0 Skip sk = create() if (true) put(sk,0,0) else a = 1
string str = "" Skip sk = create() if (true) put(sk,0,0) else str = "x"
It helps a lot to accept DXL as "quirky" than to accuse it of being "buggy". Serenity ... change what you can ... bla bla bla.
"forget everything you've ever thought to be true". Got that advise years ago from my Zen Poker Master from Pluto who then told me what was really true; but I forgot. |
Re: Put in skip list causing some -E- DXL: incorrect arguments for (if) llandale - Thu Oct 27 15:53:28 EDT 2011
"forget everything you've ever thought to be true". Got that advise years ago from my Zen Poker Master from Pluto who then told me what was really true; but I forgot.
Hi all,
int a = 0
Skip sk = create()
if (true)
{
put(sk, 0, 0)
}
else
{
a = 1
}
|
Re: Put in skip list causing some -E- DXL: incorrect arguments for (if) PDU - Fri Oct 28 02:08:41 EDT 2011
Hi all,
int a = 0
Skip sk = create()
if (true)
{
put(sk, 0, 0)
}
else
{
a = 1
}
I ALWAYS use braces around every code block, no matter how small. And I always use parentheses, even if they are "not required", especially after parameter-less functions. These rules help make the code more readable and more robust. I recommend everyone looks at the MISRA standards and takes on board good practice. PS I gave up being surprised long ago. As Louie said, you learn the workarounds by heart and move on... Tony Goodman, www.smartdxl.com |
Re: Put in skip list causing some -E- DXL: incorrect arguments for (if) Tony_Goodman - Fri Oct 28 09:17:30 EDT 2011
I use the parens as it makes it easier to clarify what is and what is not a function, something the reader needs to know. And of course because I'm somewhat weak in this area and need to break it up visually and rely heavily on matching-pairs feature of Crimson.
int a = 0
Skip sk = create()
if (true) //
then put(sk, 0, 0)
else a = 1
DoMoreWork()
//-------------------------
if (true)
{
put(sk, 0, 0)
}
else
{
a = 1
}
DoMoreWork()
|