IB - Developer Center    Forums  Hop To Forum Categories  FOCUS/WebFOCUS    Question on FOCUS
Go
New
Search
Notify
Tools
Reply
  
-star Rating Rate It!  Login/Join 
<beginner>
Posted
I have this:

DEFINE FILE BFPROD
...
...
FLNM_PRFX/A2=SUBSTR(100,FILE_NAME,1,2,2,'A2');
-IF FLNM_PRFX EQ 'RT' THEN GOTO AAA;

SEQ/A4=SUBSTR(100,FILE_NAME,31,34,4,'A4');
NEW_F/A30=SUBSTR(100,FILE_NAME,1,30,30,'A30');
TMP_NEW_F/A30=SUBSTR(100,FILE_NAME,1,30,30,'A30');
NEW_FILE/A66= NEW_F || 'XXXX.';
TMP_NEW_FILE/A38= TMP_NEW_F || 'XXXX.';
FILE_S/A38=TMP_NEW_F || SEQ ||'.';
-GOTO CONT

-AAA
SEQ/A4=SUBSTR(100,FILE_NAME,28,31,4,'A4');
NEW_F/A27=SUBSTR(100,FILE_NAME,1,27,27,'A27');
TMP_NEW_F/A27=SUBSTR(100,FILE_NAME,1,27,27,'A27');
NEW_FILE/A66= NEW_F || 'XXXX.';
TMP_NEW_FILE/A38= TMP_NEW_F || 'XXXX.';
FILE_S/A38=TMP_NEW_F || SEQ ||'.';

-CONT
...
...


The value of FLNM_PRFX was 'RT' when I test it. Why it didn't jump to AAA???
 
Reply With QuoteEdit or Delete MessageReport This Post
<Grzegorz>
Posted
The code:
-IF FLNM_PRFX EQ 'RT' THEN GOTO AAA;
is the same as comparing constants:
-IF 'FLNM_PRFX' EQ 'RT' THEN GOTO AAA;
The Dialogue Manager variables start with &:
-IF &FLNM_PRFX EQ 'RT' THEN GOTO AAA;
but remember that variable &FLNM_PRFX has nothing common with the DEFINEd field named FLNM_PRFX. Dialogue Manager commands (the lines started with -), are a kind of macrodefinitions, they are "generating" the pieces of FOCUS code for the final execution.

The Dialogue Manager commands are described in Chapter 10. "Managing Flow of Control ..." in the "Developing Reporting Application " manual (v 5.2).
IBI Tech Support Link

Regards
Grzegorz
 
Reply With QuoteEdit or Delete MessageReport This Post
<beginner>
Posted
Thank you very much. Your comment is very helpful. I understand now why it didn't work.

I tried the following way:

FLNM_PRFX/A2=SUBSTR(100,FILE_NAME,1,2,2,'A2');
SEQ/A4=IF FLNM_PRFX EQ 'RT' THEN SUBSTR(100,FILE_NAME,28,31,4,'A4')
ELSE SUBSTR(100,FILE_NAME,31,34,4,'A4');
NEW_F/A30=IF FLNM_PRFX EQ 'RT' THEN SUBSTR(100,FILE_NAME,1,27,27,'A30')
ELSE SUBSTR(100,FILE_NAME,1,30,30,'A30');
TMP_NEW_F/A30=IF FLNM_PRFX EQ 'RT' THEN SUBSTR(100,FILE_NAME,1,27,27,'A30')
ELSE SUBSTR(100,FILE_NAME,1,30,30,'A30');
NEW_FILE/A66= NEW_F || 'XXXX.';
TMP_NEW_FILE/A38= TMP_NEW_F || 'XXXX.';
FILE_S/A38=TMP_NEW_F || SEQ ||'.';


I am glad this work but I am not sure if it will create any problem in the future. Hopefully not.
 
Reply With QuoteEdit or Delete MessageReport This Post
 Previous Topic | Next Topic powered by eve community  
 

IB - Developer Center    Forums  Hop To Forum Categories  FOCUS/WebFOCUS    Question on FOCUS

Copyright © 1996-2008 Information Builders, leaders in enterprise business intelligence.