Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic DOORS (steve huntington)
Decrease font size
Increase font size
Topic Title: What's wrong with this button?
Topic Summary: button(...) results in " incorrectly concatenated tokens"
Created On: 14-Mar-2007 10:00
Status: Post and Reply
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
Quick Reply Quick Reply
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
Answer This question was answered by Thomas Langholz, on Wednesday, March 14, 2007 11:24 AM

Answer:
try DBE calledfrom instead of DB b within head of callback function this should work cu thomas
 14-Mar-2007 10:00
User is offline View Users Profile Print this message


Martin Erdelen

Posts: 15
Joined: 14-Aug-2006

Hello,

why does this code



///////////// code start

DB b = create("Why does this not work?",styleCentered)

void noAction(DB b) {
  print "nothing done\n"
  hide(b)
}



DBE btn = button(b, "TestButton", noAction)
show b

/////////////code end


result in these [alleged ] errors:

-E- DXL: incorrect arguments for function (button)
-E- DXL: incorrectly concatenated tokens


???

Thanks for all hints.

Cheers,
Martin


Edited: 14-Mar-2007 at 10:09 by Martin Erdelen
Report this to a Moderator Report this to a Moderator
 14-Mar-2007 10:11
User is offline View Users Profile Print this message


Thomas Langholz

Posts: 40
Joined: 20-Oct-2005

Answer Answer
try DBE calledfrom instead of DB b within head of callback function this should work cu thomas

Edited: 14-Mar-2007 at 10:14 by Thomas Langholz
Report this to a Moderator Report this to a Moderator
 14-Mar-2007 11:24
User is offline View Users Profile Print this message


Martin Erdelen

Posts: 15
Joined: 14-Aug-2006

It works indeed -- thanks for the prompt reply, Thomas!

(...and I am not going to ask why this is a concatenation error  ! )

Cheers,
Martin

Report this to a Moderator Report this to a Moderator
 14-Mar-2007 12:07
User is offline View Users Profile Print this message


David Pechacek

Posts: 674
Joined: 5-Dec-2006

Only apply() and close() buttons have a DB value passed to the callback function.

-------------------------
David Pechacek
AAI Services Textron
dpechacek@sc-aaicorp.com
David.Pechacek@gmail.com
Report this to a Moderator Report this to a Moderator
 19-Mar-2007 03:52
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

Yes.

'ok' and 'apply' and 'close' functions created things that look like button on the lowest most line of the dialog. Notice they required a function that has a single 'DB' parameter.

'button' functions create things that are buttons within the body of the dialog. It requires a function with a single parameter of type DBE. It also returns a type 'DBE" allowing you to assign it to a DBE variable and then manipulate it, such as positioning it in the dialog.

The call parameter DB or DBE can be used by the function to determine which element was actually pushed. I'm not sure I've ever actually done that since I generally write my scripts such that each Element has exactly one corresponding function, and the function implicitely knows which element it works for. Thus, I routinely use dummy parameters in the callbacks, e.g. "void btnDelete(DBE dbeXX)"

Attached is a little ditty to demonstate some of this. Notice that since the functions sometimes refer to known DB and DBE variables, I generally declare them globally at the top. Since the creation of the DB often requires callbacks and these callbacks routinely call functions that do actual work, I routinely put the creation of the DB at the bottom of my scripts.

Notice that the repoisitoning worked. I failed to get dbe1 and dbe2 to swap places, either with them origiunally declared 'beside' each other. DBE repositioning is a nightmare. There are far too many exceptions for me to keep track of.

- Louie
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 2 users logged in.
The most users ever online was 15 on 15-Jan-2009 at 16:36.
There are currently 0 guests browsing this forum, which makes a total of 2 users using this forum.
You have posted 0 messages to this forum. 0 overall.

FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.