Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic Rhapsody (steve huntington)
Decrease font size
Increase font size
Topic Title: Help with Syntax error
Topic Summary:
Created On: 21-May-2007 09:59
Status: Read Only
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
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.
 21-May-2007 09:59
User is offline View Users Profile Print this message


Crystle Pishon

Posts: 6
Joined: 9-Nov-2006

Can anyone tell me why I continue to get the sytax error:

syntax error at "in":missing in

in the following code?

there_exists x in filter {
$name of [tags] = "AquisitionMethod"

}
over
all classes

I get this error when I try to run other templates I've downloaded off this forum that use any statement with "in", and any variation of the above code as well.

I'll take any ideas as I'm getting very frustrated.

Thanks
Report this to a Moderator Report this to a Moderator
 21-May-2007 15:51
User is offline View Users Profile Print this message


Simon Morrish

Posts: 127
Joined: 17-May-2005

Hi

I've taken a look, but I found it difficult to understand what you're trying to achieve. Certainly the code you posted generates a Q syntax error, although I get: [CODE]ERROR-- (6,12): Syntax error at EOF: missing =>[/CODE]

To make it valid Q, I changed it to:
[CODE]there_exists x in (
filter {$name of [tags] = "AquisitionMethod"}
over all "Class"
)
=> $name <> ""[/CODE] which will evaluate to "true" if any such classes exist.

This sub-expression:
[CODE]filter {$name of [tags] = "AquisitionMethod"}
over all "Class"[/CODE] evaluates to a collection of all classes with a single tag named "AquisitionMethod"; it will exclude classes with more than one tag, since $name of [tags] evaluates to a comma-separated list of the names of all tags. I guess this is not what you intended.

I imagine you might have intended:
[CODE]filter {
there_exists TAG in [tags]
=> $name of TAG = "AquisitionMethod"
}
over all "Class"[/CODE] which evaluates to a collection of all classes with a tag named "AquisitionMethod".

Does that help? Please let me know if it does, or follow-up with a bit more detail (i.e. what you're trying to achieve) and I'll help more.

cheers,
Simon

-------------------------
Simon Morrish
simon.morrish@eu.panasonic.com
http://panasonic.co.uk
Panasonic ideas for life
Report this to a Moderator Report this to a Moderator
 21-May-2007 23:57
User is offline View Users Profile Print this message


Crystle Pishon

Posts: 6
Joined: 9-Nov-2006

If it seems I'm confused, I am.

What I'm trying to do is to find all the classes that have a tag with the name "AquisitionMethod" among all the tags it has (so yes it isn't the only one). After getting these classes I want to print the name of the class, the name and value of the "AquisitionMethod" tag and the name and the value of another Tag called "ReuseProductName".

I can get a simple filter work when looking for classes with a particular value of the "AquisitionMethod" tag, but then I can't get the "ReuseProductName" tag to print at the same time. Generally these are the only two tags I want to print, and they should always both be present in a given class.

I think what I'm trying to do is simple but I can't seem to get there using the bits and snipets of info on Q language that I've been able to find.
Report this to a Moderator Report this to a Moderator
 22-May-2007 12:40
User is offline View Users Profile Print this message


Simon Morrish

Posts: 127
Joined: 17-May-2005

Hi

You're right; Q-language is very scantily documented. Nevertheless, it's worth persevering with, as once you get your head around it, it's very powerful.

I've enclosed a template (and an example model) which should give you what you want, in three different ways;

[list=1]
[*] All within a single, complex Q expression
[*] Using a single iteration through the classes, with one simple Q expression to filter the iteration, and two to output the attribute values.
[*] Using an iteration throught the classes, and a sub-iteration through the tags, with two simple Q expressions to filter the iterations.[/list]

Take a look and see if that makes things clearer. Let me know how you get on. I'm happy to explain further, but I thought I'd let you see an example first...

cheers,
Simon

SupportQTags.zip
SupportQTags.zip  (4 KB)



-------------------------
Simon Morrish
simon.morrish@eu.panasonic.com
http://panasonic.co.uk
Panasonic ideas for life
Report this to a Moderator Report this to a Moderator
 23-May-2007 15:34
User is offline View Users Profile Print this message


Crystle Pishon

Posts: 6
Joined: 9-Nov-2006

I tried using your template examples but continued to have the same problems - so I figured I MUST have something wrong on my end.

After several tech support samples also failed to work they told me to upgrade to 7.0 MR3 or 7.1 and see if that fixes the problem.

Today I install MR3 (while waiting for our license server to upgrade) and voila! Your examples worked and I've managed to incorporate them into my template.

Thank you so much and please consider writing 'Q Language for Dummies' for those of us who need examples to follow.
Report this to a Moderator Report this to a Moderator
 24-May-2007 16:00
User is offline View Users Profile Print this message


Simon Morrish

Posts: 127
Joined: 17-May-2005

I'm glad that helped. Could you post back which version of Rhapsody you were using, so I (and others) can avoid it?

I'll certainly consider writing something up; it's actually on my to do list, but difficult to find the time to allocate to it...

all the best,
Simon

-------------------------
Simon Morrish
simon.morrish@eu.panasonic.com
http://panasonic.co.uk
Panasonic ideas for life
Report this to a Moderator Report this to a Moderator
 29-May-2007 16:19
User is offline View Users Profile Print this message


Crystle Pishon

Posts: 6
Joined: 9-Nov-2006

I was using Rhapsody 7.0 build number 749936 which support referred to as MR1.

I've upgraded to MR3 or build number 764608 and so far ReporterPlus has worked well with examples from this forum and modifications I have made.

Thanks again.
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic Rhapsody forum.
There are currently 1 users logged in.
You have posted 0 messages to this forum. 0 overall.

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