× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.


  • Subject: RE: CF - One last question about ambiguity
  • From: Buck Calabro <mcalabro@xxxxxxxxxxxx>
  • Date: Mon, 16 Aug 1999 09:31:09 -0400

John,

You bring up some very valid, very specific examples - thanks for that!  I
deal much better with examples like this than I do with "I just don't think
it'll work out."  My own communication flaws coming to the fore there.

>For example, on the CF UPDATE CHAIN READ 
>statement Just what should the compiler take 
>for granted?  How will it really know what I meant?   
>And, No I don't think quotes 'UPDATE'  (like SQL) will 
>work.   You tell me why. 

Having opened my mouth to submit the SQL "solution", I'll hit the last one
first (backwards to the end!)  I would not use single quotes (which would be
confused with a literal) but double quotes (which is the SQL standard.)

The difficulty lies in distribute 2 or 3 tokens among the 4 possible slots:
F1, Op, F2, Result.  Your 3 token examples are killer, John!  Without some
sort of delimiter to detect the Opcodes from the operands, these would be
impossible to parse without assumptions:

>CF   READ  CHAIN READ

This could either be Op, F2, Res or F1, Op, F2.  The problem is trying to
discriminate between the opcode and the operands.  Wrapping the double
quotes around the operands would fix this one: "READ" CHAIN "READ" makes it
clear that CHAIN is the opcode.  I believe that this works for all possible
3 token statements, including:
CF   WRITE "READ" "CHAIN"
CF  UPDATE "CHAIN" "READ"
CF  READ "WHEN" "CHAIN"
CF "READ" Acq "CHAIN"
CF "ADD" Sub "ADD"
CF 'READ' Lokup "READE" - Single quote means literal factor 1.

Oddly enough, the 4 token statement is the easiest one of all, in that
there's only one way to parse this:
>CF  UPDATE READE WHEN READ

"UPDATE" Reade "WHEN" "READ"

Lines like this should fail to compile because the name of F1 (a field) is
the same as F2 (a file):
"READ" Chain "READ", but it should parse properly into F1, Op, F2..

It sure is ugly, but at least I didn't have to rename my fields!  That
should go a ways toward compatibility, no?

Buck Calabro

+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---


As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.