Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] Counting Lines of WF Code

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] Counting Lines of WF Code
 Login/Join
 
Platinum Member
posted
Is there a tool that can count the number of lines of WebFocus code?

This message has been edited. Last edited by: Kerry,


WF 7.7.05
HP-UX - Reporting Server, Windows 2008 - Client, MSSQL 2008, FOCUS Databases, Flat Files
HTML, Excel, PDF
 
Posts: 149 | Location: Dallas, TX | Registered: June 08, 2007Report This Post
Platinum Member
posted Hide Post
her's a program I wrote for this type of thing
master

FILE=WFEXNAME,SUFFIX=FIX
SEGNAME=WFEXNAME ,SEGTYPE=S1
FIELDNAME =PROGCODE,E01,A256,A256,$

program:
-DEFAULT &ECHO='OFF'
-SET &APP_FOLDER = '&Application_Folder.EVAL';
-SET &WF_SERVER = '&WebFOCUS_Server.EVAL';
-SET &PROGRAM_NAME = '&FOCEXEC_Name.EVAL';
SET ASNAMES=ON, NODATA = ' ', %STRICTMATH = OLD, ALL = ON, MSG = ON
SET PRINTPLUS = ON
SET PSPAGESETUP = ON
-SET &APP_FOLDER = '&Application_Folder.EVAL';
-SET &WF_SERVER = '&WebFOCUS_Server.EVAL';
-SET &PROGRAM_NAME = '&FOCEXEC_Name.EVAL';
FILEDEF WFEXNAME DISK //&WF_SERVER../apps/&APP_FOLDER../&PROGRAM_NAME
TABLE FILE WFEXNAME
LIST PROGCODE
ON TABLE HOLD AS HWFDOC1
END
-RUN
DEFINE FILE HWFDOC1
INCS/A256 = IF EDIT(PROGCODE,'99999999') EQ '-INCLUDE' THEN PROGCODE ELSE ' ';
INCSCNT/I6 = IF INCS NE ' ' THEN 1 ELSE 0;
EXECS/A256 = IF EDIT(PROGCODE,'999') EQ 'EX ' THEN PROGCODE ELSE
IF EDIT(PROGCODE,'99999') EQ 'EXEC ' THEN PROGCODE ELSE ' ';
EXECCNT/I6 = IF EXECS NE ' ' THEN 1 ELSE 0;
COMMENTS/A256= IF EDIT(PROGCODE,'99') EQ '-*' THEN PROGCODE ELSE ' ';
COMMENTCNT/I6= IF COMMENTS NE ' ' THEN 1 ELSE 0;
FDEFS/A256 = IF EDIT(PROGCODE,'99999999') EQ 'FILEDEF ' THEN PROGCODE ELSE ' ';
FDEFCNT/I6 = IF FDEFS NE ' ' THEN 1 ELSE 0;
SETSX/A256 = IF EDIT(PROGCODE,'9999 ') EQ 'SET ' THEN PROGCODE ELSE ' ';
SETCNT/I6 = IF SETSX NE ' ' THEN 1 ELSE 0;
LINECNT/I6 = IF PROGCODE NE ' ' THEN 1 ELSE 0;
VARSLINE/I6 = IF PROGCODE CONTAINS '&' THEN 1 ELSE 0 ;
COMMENTS/A256= IF EDIT(PROGCODE,'99') EQ '-*' THEN PROGCODE ELSE ' ';
DMCODE/I6 = IF EDIT(PROGCODE,'9') EQ '-' AND COMMENTS EQ ' ' THEN 1 ELSE 0;
END
TABLE FILE HWFDOC1
PRINT E02 AS ''
BY E01 AS ''
BY VARSLINE NOPRINT
BY DMCODE NOPRINT
BY INCSCNT NOPRINT
ON TABLE SUBHEAD
"WebFOCUS Code Documentor <+0 Printed: <+0 &DATEMtrDYY"
"Server: <+0 &WF_SERVER <+0 Application Folder: <+0 &APP_FOLDER <+0 Program: <+0 &PROGRAM_NAME "
"Total lines of Code : <+0 "FOCUS Statements: "
" Total -INCLUDEs: <+0 " Total EX or EXECs: <+0 " Total Comments: <+0 " Total SETs: <+0 " Total FILEDEFs: <+0 " Blue text <+0 on shaded lines are Dialogue Manager statements."
" Red text <+0 on shaded lines contain Dialogue Manager local or global variables."
" Yellow text <+0 on shaded lines are -INCLUDE statements."
FOOTING CENTER
" Page WHERE PROGCODE NE ' ';
-* File inc_pdf.FEX
ON TABLE NOTOTAL
ON TABLE SET PAGE NOLEAD
ON TABLE SET ONLINE-FMT PDF
ON TABLE SET STYLE *
UNITS=IN,
PAGESIZE= 'LEGAL' ,
LEFTMARGIN=0.100,
RIGHTMARGIN=0.100,
TOPMARGIN=0.150,
BOTTOMMARGIN=0.150,
SQUEEZE=ON,
ORIENTATION=PORTRAIT,$
TYPE=REPORT, FONT='COURIER_NEW', SIZE=8, COLOR='BLACK', BACKCOLOR='NONE', STYLE=NORMAL,
TOPGAP=0.013889,BOTTOMGAP=0.027778,LEFTGAP=.06,RIGHTGAP=.05,$
TYPE=DATA, STYLE=BOLD,COLOR=RGB(251 251 0),BACKCOLOR=BLACK,WHEN=INCSCNT NE 0,$
TYPE=DATA, STYLE=BOLD,COLOR=RED,BACKCOLOR=RGB(211 255 204),WHEN=VARSLINE NE 0,$
TYPE=DATA, STYLE=BOLD,COLOR=BLUE,BACKCOLOR=RGB(235 255 204),WHEN=DMCODE NE 0,$
TYPE=REPORT, COLUMN=E02,WRAP=7.75,$
TYPE=TABHEADING, SIZE=8,FONT='TIMES NEW ROMAN',$
TYPE=TABHEADING, LINE=1, STYLE=BOLD,$
TYPE=TABHEADING, LINE=1, OBJECT=TEXT,ITEM=2, POSITION = 6.0,$
TYPE=TABHEADING, LINE=1, OBJECT=TEXT,ITEM=3, STYLE=NORMAL,POSITION=+.10,$
$
TYPE=TABHEADING, LINE=2, OBJECT=TEXT,ITEM=1, STYLE=BOLD,$
TYPE=TABHEADING, LINE=2, OBJECT=TEXT,ITEM=2, STYLE=NORMAL, POSITION=+.10,$
TYPE=TABHEADING, LINE=2, OBJECT=TEXT,ITEM=3, STYLE=BOLD,POSITION=+.25,$
TYPE=TABHEADING, LINE=2, OBJECT=TEXT,ITEM=4, STYLE=NORMAL, POSITION=+.10,$
TYPE=TABHEADING, LINE=2, OBJECT=TEXT,ITEM=5, STYLE=BOLD,POSITION=+.25,$
TYPE=TABHEADING, LINE=2, OBJECT=TEXT,ITEM=6, STYLE=NORMAL, POSITION=+.10,$
TYPE=TABHEADING, LINE=3, OBJECT=TEXT,ITEM=1, STYLE=BOLD,$
TYPE=TABHEADING, LINE=3, OBJECT=FIELD,ITEM=1, POSITION = 1.0,$
TYPE=TABHEADING, LINE=4, STYLE=BOLD,$
TYPE=TABHEADING, LINE=5, OBJECT=TEXT,ITEM=1, STYLE=BOLD,$
TYPE=TABHEADING, LINE=5, OBJECT=FIELD,ITEM=1, POSITION = 1.0,$
TYPE=TABHEADING, LINE=6, OBJECT=TEXT,ITEM=1, STYLE=BOLD,$
TYPE=TABHEADING, LINE=6, OBJECT=FIELD,ITEM=1, POSITION = 1.0,$
TYPE=TABHEADING, LINE=7, OBJECT=TEXT,ITEM=1, STYLE=BOLD,$
TYPE=TABHEADING, LINE=7, OBJECT=FIELD,ITEM=1, POSITION = 1.0,$
TYPE=TABHEADING, LINE=8, OBJECT=TEXT,ITEM=1, STYLE=BOLD,$
TYPE=TABHEADING, LINE=8, OBJECT=FIELD,ITEM=1, POSITION = 1.0,$
TYPE=TABHEADING, LINE=9, OBJECT=TEXT,ITEM=1, STYLE=BOLD,$
TYPE=TABHEADING, LINE=9, OBJECT=FIELD,ITEM=1, POSITION = 1.0,$
TYPE=TABHEADING, LINE=10, COLOR=BLUE,BACKCOLOR=RGB(235 255 204),$
TYPE=TABHEADING, LINE=11, COLOR=RED,BACKCOLOR=RGB(211 255 204),$
TYPE=TABHEADING, LINE=12, COLOR=RGB(251 251 0),BACKCOLOR=BLACK,$
TYPE=FOOTING, SIZE=8,FONT='TIMES NEW ROMAN',$
ENDSTYLE
END
-RUN

This message has been edited. Last edited by: RickW,


WebFOCUS 7.6.6/TomCat/Win2003,SQL Server 2005,Oracle
 
Posts: 125 | Location: New England | Registered: February 20, 2007Report This Post
Master
posted Hide Post
I see you are on UNIX, so try this script:

# cd to the app folder
cd /opt/ibi/apps
# create a file of the folder names in the apps folder
ls -d * > /home/eda/apps.lst
# loop through the file counting the lines of code
foreach folder (`cat /home/eda/apps.lst`)
  cd $folder
  wc -l *.fex >> /home/eda/fexcnt.dat
  wc -l *.sh >> /home/eda/fexcnt.dat
  wc -l *.htm* >> /home/eda/fexcnt.dat
  cd ..
end


When you're done, fexcnt.dat has all the lines of code in each program, script and htm file.

You can then import that into EXCEL and do a SUM or you can create a master to read fexcnt.dat and a fex to sum the counts.


In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
 
Posts: 975 | Location: Oklahoma City | Registered: October 27, 2006Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] Counting Lines of WF Code

Copyright © 1996-2020 Information Builders