Discussion:
openqm TRANS or XLATE with I type dictionary Item
(too old to reply)
wilson
2011-02-18 12:24:01 UTC
Permalink
http://mvcommunitymap.com/openqm/index.html?qmb_trans.htm

says:

"Examples

TOTAL.VALUE = QTY * TRANS('STOCK', PART.NO, 'PRICE', 'X')

The above statement reads from the STOCK file a record (or list of
records) whose id(s) can be found in the PART.NO variable. The X error
code causes the TRANS() function to return a null value for any record
that cannot be found.

X = TRANS(DICT 'ORDERS', 'DISCOUNT', 'X')

X = TRANS('DICT ORDERS', 'DISCOUNT', 'X')

Both of the above statements perform the same action. Either might be
used, for example, to retrieve an I-type item named DISCOUNT from the
dictionary of the ORDERS file."

I set up orders with demo dict item TEST

1: C
2: @ANS = "1234"
3:
4: ORDERS
5: 5R
6: S

LIST ORDERS TEST

returns "1234" OK

a program:

PRINT TRANS(DICT "ORDERS",1,"TEST","X")
END

formatted as the manual above states - returned is a null value (where
there is an item "1") in ORDERS

I thought the above isn't correct

PRINT TRANS("ORDERS",1,"TEST","X") would be more correct?

with that you get (hex address):Invalid I-type at line number of PROGNAME

Can anyone tell me why this doesn't work per example on website above -
or supply an example ...

would like to use TRANS/XLATE -- or even an OCONV to access the value of
an I type dictionary item with passed

tried setting @ID in the program -- still no luck
wilson
2011-02-18 12:44:24 UTC
Permalink
Have confused C (calculated type) with I type ---

Is it possible to use TRANS/XLATE with C types?

I would like to access a dictionary C type from a program
Martin Phillips
2011-02-18 15:36:36 UTC
Permalink
Post by wilson
Is it possible to use TRANS/XLATE with C types?
You can use TRANS() in C-types in exactly the same way as in programs.
Alternatively, you can reference another data item defined in the same
dictionary using expressions such as
X = {name}
where name is the item to be referenced. The curly brackets are part
of the syntax.
Post by wilson
I would like to access a dictionary C type from a program
The ITYPE() function can do this. It can access all data types in QM,
not just I-type items. This includes D/A/S type items which, although
not all that sensible compared to direct reference to the field,
allows a program to access a data item without knowing its type.


Martin Phillips, Ladybridge Systems.
Kevin Powick
2011-02-18 15:14:27 UTC
Permalink
Post by wilson
http://mvcommunitymap.com/openqm/index.html?qmb_trans.htm
I haven't looked into this beyond the fact that you're using a copy of
the QM manual from 2007. Perhaps there have been changes to the
command.

However, and more important, that material is copyrighted and shouldn't
be on your website without permission from Ladybridge.

Why not simply link to their up-to-date on-line manual and save
yourself the issues of being outdated and illegal?

http://www.openqm.org/docs/

--
Kevin Powick
wilson
2011-02-18 16:54:06 UTC
Permalink
Post by Kevin Powick
Post by wilson
http://mvcommunitymap.com/openqm/index.html?qmb_trans.htm
I haven't looked into this beyond the fact that you're using a copy of
the QM manual from 2007. Perhaps there have been changes to the
command.
However, and more important, that material is copyrighted and shouldn't
be on your website without permission from Ladybridge.
Why not simply link to their up-to-date on-line manual and save yourself
the issues of being outdated and illegal?
http://www.openqm.org/docs/
no idea what you are talking about - not my website .... ?????
Kevin Powick
2011-02-18 19:03:47 UTC
Permalink
Post by wilson
no idea what you are talking about - not my website .... ?????
Apologies. I was under the impression that is was.

--
Kevin Powick
frosty
2011-02-18 19:20:27 UTC
Permalink
Post by Kevin Powick
Post by wilson
no idea what you are talking about - not my website .... ?????
Apologies. I was under the impression that is was.
Appears that page and the domain mvcommunitymap.com belong to Curt Stewart:

http://www.linkedin.com/in/curtstewart
--
frosty
Kevin Powick
2011-02-19 02:12:52 UTC
Permalink
Yes, TG mentioned that to me as well. I'm not sure why I jumped to the
mistaken conclusion that it belonged to the OP. Maybe it was the booze.

--
Kevin Powick
wilson
2011-02-18 16:59:26 UTC
Permalink
Post by Kevin Powick
Post by wilson
http://mvcommunitymap.com/openqm/index.html?qmb_trans.htm
I haven't looked into this beyond the fact that you're using a copy of
the QM manual from 2007. Perhaps there have been changes to the
command.
However, and more important, that material is copyrighted and shouldn't
be on your website without permission from Ladybridge.
Why not simply link to their up-to-date on-line manual and save yourself
the issues of being outdated and illegal?
http://www.openqm.org/docs/
unpleasant officious little man
Kevin Powick
2011-02-18 19:04:51 UTC
Permalink
Post by wilson
unpleasant officious little man
Had to be a dick about an honest mistake, eh?

--
Kevin Powick
Whistle Blower
2011-03-06 09:56:59 UTC
Permalink
This post might be inappropriate. Click to display it.
Charlie Noah
2011-03-07 13:42:36 UTC
Permalink
Post by Kevin Powick
Post by wilson
http://mvcommunitymap.com/openqm/index.html?qmb_trans.htm
I haven't looked into this beyond the fact that you're using a copy of
the QM manual from 2007.  Perhaps there have been changes to the
command.
However, and more important, that material is copyrighted and shouldn't
be on your website without permission from Ladybridge.
Why not simply link to their up-to-date on-line manual and save
yourself the issues of being outdated and illegal?
http://www.openqm.org/docs/
--
Kevin Powick
hi kevin. just popping in to let  you know that you have made a
mistake with the sorts of things you have been posting at
alt.gathering.rainbow
that is a very old usenet group with a stated purpose. your postings
are consistently offtopic, rude, crude and offensive. you are acting
like a juvenile delinquent in that forum and being exceptionally and
very immaturely intrusive and disruptive.
 i am nearly twice your age and, among other things, am a military
communications technology instructor. you cannot possibly protect
yourself or your equipment from my associates if you piss me off
enough for me to ask them to rattle your cage.
Whistle Blower,

I don't know who you are, as you don't have the courage to create a
profile, and it's probably not worth the effort to find out, but you
are way out of line here. I looked at your alt.gathering.rainbow
group, and the person you think is Kevin definitely is not. He is an
upstanding, long-time member of the MV community, and if you think
you're twice his age, then you really don't know him. He says what he
thinks, but is certainly not "consistently offtopic, rude, crude and
offensive". Personally, I prefer that someone says what they think,
rather than agreeing with everything anyone says.

Your thinly veiled threats are not appreciated, and show just what
type of person you are.

Regards,
Charlie Noah
Charles W. Noah Associates
***@comcast.net

The views and opinions expressed herein are my own (Charlie Noah) and
do not necessarily reflect the views, positions or policies of any of
my former, current or future employers, employees, clients, friends,
enemies or anyone else who might take exception to them.
Martin Phillips
2011-02-18 16:09:19 UTC
Permalink
Some further thoughts on why your original program did no work....
Post by wilson
PRINT TRANS("ORDERS",1,"TEST","X") would be more correct?
with that you get (hex address):Invalid I-type at line number of PROGNAME
When used in a program (as against a dictionary item), the third
argument to TRANS() must be a field number, not the name of the field.


Martin Phillips, Ladybridge Systems
wilson
2011-02-18 16:54:43 UTC
Permalink
Post by Martin Phillips
Some further thoughts on why your original program did no work....
PRINT TRANS("ORDERS",1,"TEST","X") would be more correct? with that you
get (hex address):Invalid I-type at line number of PROGNAME
When used in a program (as against a dictionary item), the third
argument to TRANS() must be a field number, not the name of the field.
Martin Phillips, Ladybridge Systems
ok thanks
g***@gmail.com
2013-12-26 21:18:28 UTC
Permalink
Post by Martin Phillips
Some further thoughts on why your original program did no work....
Post by wilson
PRINT TRANS("ORDERS",1,"TEST","X") would be more correct?
with that you get (hex address):Invalid I-type at line number of PROGNAME
When used in a program (as against a dictionary item), the third
argument to TRANS() must be a field number, not the name of the field.
Martin Phillips, Ladybridge Systems
Maybe I am a little bit late on this... nevertheless, I am trying to use the trans function today (Why? Because it is useful) and I am trying to use this feature (Why? Because that would mean lot of time-code-stress savings... if I could make the thing work), and I ran into this thread. Which is actually about what I was looking for. It happens to be that the company I work with owns the license for QM, and I read the manual (most of it... I think), and I have read the pages about trans() many times. First, it is not cool to have rtrans listed in the pdf within trans... it confuses, and it is not the only function without its own entry in the menu. I can live with that... Second, examples are either too few or too short, so I get a hard time figuring out how to make things work. Yet, I can deal with that, too: labor omnia vinci... And last, but no least, the ***** manual DOES say the function should work the way Wilson wrote down! Not only the pdf, but the on-line (wanna-be-up-to-date) version:
"TOTAL.VALUE = QTY * TRANS('STOCK', PART.NO, 'PRICE', 'X')" (sic, http://www.openqm.org/docs/index.html?qmb_trans.htm, Dec/26/2013).

In the same page:
"When used in a dictionary I-type expression this can also be
A data item (A/C/D/I/S-type) defined in the target file's dictionary. If the field name does not follow the rules for construction of QMBasic variable names, it must be quoted." (sic)

On the other hand, if you are right, then the manual has been wrong for years now... but it clearly says "field name", not 'field number', nor it claims that field has to be numeric.

Anyways, I am giving up with that. Just a word of advise for the next person looking for the way to make this work: do not trust the QM manual.

Best regards.
e***@gmail.com
2014-02-07 01:25:30 UTC
Permalink
What version number of OpenQM is it?

Also, what edition (personal, etc.)

Robert Norman

ROBERT NORMAN AND ASSOCIATES
23441 Golden Springs Dr., #289, Diamond Bar, CA 91765
(951) 541-1668
http://universe-basic-programming.webstarts.com/index.html
http://users.keyway.net/~ice/
http://www.affordablemultivalueprogramming.i8.com/
Affordable computer consulting services for these environments and languages:
* UNIVERSE (language: UNIVERSE BASIC)
* CACHE (language: MV BASIC)
* INFORMATION (language: INFO/BASIC)
* jBASE (language: jBC, jBASE BASIC, jBASIC)
* MENTOR System (language: DATA/BASIC, DATABASIC, DATA BASIC)
* MVENTERPRISE (language: MVENTERPRISE BASIC)
* MVON/ONWARE (language: ONWARE BASIC)
* OPENINSIGHT (language: BASIC+)
* OPENQM, QM (language: QMBASIC)
* PICK, Advanced PICK, D3 (language: PICK BASIC)
* Power95 (language: DATA/BASIC, DATABASIC, DATA BASIC)
* REALITY System (language: DATA/BASIC, DATABASIC, DATA BASIC)
* REVELATION, Advanced REVELATION (language: R/BASIC, REVELATION BASIC)
* UNIDATA (language: UNIBASIC)
* UNIVISION (language: UVBASIC)
* WebSphere DataStage (language: DSBASIC, DataStage BASIC)
Post by g***@gmail.com
Post by Martin Phillips
Some further thoughts on why your original program did no work....
Post by wilson
PRINT TRANS("ORDERS",1,"TEST","X") would be more correct?
with that you get (hex address):Invalid I-type at line number of PROGNAME
When used in a program (as against a dictionary item), the third
argument to TRANS() must be a field number, not the name of the field.
Martin Phillips, Ladybridge Systems
"TOTAL.VALUE = QTY * TRANS('STOCK', PART.NO, 'PRICE', 'X')" (sic, http://www.openqm.org/docs/index.html?qmb_trans.htm, Dec/26/2013).
"When used in a dictionary I-type expression this can also be
A data item (A/C/D/I/S-type) defined in the target file's dictionary. If the field name does not follow the rules for construction of QMBasic variable names, it must be quoted." (sic)
On the other hand, if you are right, then the manual has been wrong for years now... but it clearly says "field name", not 'field number', nor it claims that field has to be numeric.
Anyways, I am giving up with that. Just a word of advise for the next person looking for the way to make this work: do not trust the QM manual.
Best regards.
Loading...