Focal Point
Line Continuation in dialog manager & FML

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/7611088331

July 21, 2005, 12:57 AM
Matthew
Line Continuation in dialog manager & FML
Is there a way to use line continuation on a FML statement? I have a really long line and would like wrap it, but I cannot figure out how to insert a continuation character?
July 21, 2005, 09:36 AM
Tony A
Matthew,

Your topic line suggests both Dialogue Manager and FML, is this correct? or is it just FML you are having problems extending the line on?

Just in case it's both -

DM - just start the continuation line with a 'hyphen' / 'dash' call it what you will.

FML - Within the styling, this isn't a problem as it's the same as basic TABLE and GRAPH

Otherwise just continue it onto the next line just making sure you have the required number of "OVER"s.

To use an old favorite example -

TABLE FILE CAR
SUM RETAIL_COST
DEALER_COST
ACROSS COUNTRY
FOR CAR
'JENSEN' OR 'ALFA ROMEO' AS 'Performance Cars'
OVER
'PEUGEOT' OR
'DATSUN'
OR 'AUDI' AS 'Old Favorites'
OVER
'BMW' OR 'TRIUMPH'
AS 'Boy Racers'
END

As you can see the lines are split across many lines and require no continuation character.

I hasten to add that I don't like this example as I prefer neat, maintainable code, but the above is just to show you can achieve many lines for a single FML control line.

Enjoy .......
July 21, 2005, 02:19 PM
Matthew
Thanks. I did get the FML to
work as you described. But I stil
cannot get DM to act as you
described. An example line of code
is below:
COMPUTE CP_ACT/D8CB = IF 
((MRDATE GE &C_A_A_B AND MRDATE 
LE &C_A_A_E) AND 
(DATATYPE_PARENT EQ 'ACTUALS' 
OR 'NORM_FP&|A')) OR 
((MRDATE GE &C_A_E_B AND MRDATE 
LE &C_A_E_E) AND DATATYPE_PARENT EQ 'FORECAST_FUTURE') THEN REVENUE_
AMOUNT / 1000 ELSE 0;  
As you can see it is
long and I would like to break it up. When
I break it of the middle 'or'
and add a '-' at the begginning
of the second line like this
COMPUTE CP_ACT/D8CB = IF 
((MRDATE GE &C_A_A_B AND MRDATE 
LE &C_A_A_E) AND (DATATYPE_PARENT EQ 'ACTUALS' OR 'NORM_FP&|A')) 
-OR ((MRDATE GE &C_A_E_B AND MRDATE 
LE &C_A_E_E) AND DATATYPE_PARENT EQ 'FORECAST_FUTURE') 
THEN REVENUE_AMOUNT / 1000 ELSE 0;
I get an error saying
"0 ERROR AT OR NEAR LINE
35 IN PROCEDURE Test FOCEXEC
(FOC303) CONTROL L
INE NOT RECOGNIZED IN FOCEXEC:
What am I doing wrong?

This message has been edited. Last edited by: <Mabel>,
July 21, 2005, 03:27 PM
Tony A
Matthew,

COMPUTE is not dialogue manager.

Have you always been using a hyphen to continue COMPUTE lines? If you have then no wonder they give an error.

I am not aware of any restrictions to using the COMPUTE over a couple of lines as in -

TABLE FILE GGSALES
SUM UNITS
DOLLARS
COMPUTE DIFF/D12.2 =
DOLLARS - UNITS ; AS 'DIFFERENCE'
BY CATEGORY SUBTOTAL
BY PRODUCT
BY REGION SUBTOTAL
BY ST
July 21, 2005, 03:33 PM
j.gross
COMPUTE is Focus, not Dialog Manager. Really two separate languages, interspersed in the fex. Any line with - in column 1 (or blank in 1 and - in 2) is interpreted as a DM statement; anything else is FOCUS.

Your FOC303 is because the line does not make sense as a DM statement. Take out the - and you're ok.

By the way, if you ever have to break an arithmetic expression (in COMPUTE or DEFINE) just before a minus sign, make sure to indent two columns on the next line, or you'll earn another FOC303.