From: SMTP%"chris@ccastat.demon.co.uk" 23-MAY-1996 11:32:22.63 To: everhart@star.zko.dec.com, ARNE@ko.hhs.dk, canellis@apache.brooks.af.mil, SCANDORA@cmt.anl.gov CC: Subj: SDLIFDL.4-OF-8 -+-+-+-+-+-+-+-+ START OF PART 4 -+-+-+-+-+-+-+-+ XIt`20generates`20a`20'main'`20file,`20of`20the`20same`20name`20as`20the`20inpu Vt,`20and`20subsidiary`20files Xcalled`20-.ifdl,`20provided`20the`20output`20file`20name`20i Vs`20not`20specified Xon`20the`20command`20line`20(if`20it`20is,`20you'll`20get`20lots`20of`20files V`20of`20the`20same`20name). X XThe`20somewhat`20non-standard`20behaviour`20of`20creating`20lots`20of`20output V`20files`20makes`20it Xmore`20usable`20for`20us,`20since`20DECforms`20needs`20to`20be`20able`20to`20i Vnclude`20structures Xseparately. X XIt`20only`20translates`20item`20`26`20structure`20declarations`20-`20the`20res Vt`20are`20left`20as Xcomments. X XIt's`20quite`20new,`20so`20I'd`20appreciate`20any`20feedback`20on`20bugs`20and V`20enhancements. X X23-MAY-1996`20V1.00-01 X`09assist`20with`20back-translation; X`09standardise`20build`20to`20work`20elsewhere; X`09insert`20group`20to`20avoid`20occurs`20on`20a`20data`20item X XChris`20Sharman,`20CCA`20Stationery,`20Eastway,`20Fulwood,`20Preston,`20PR2`20 V9WS,`20ENGLAND. Xchris@ccagroup.co.uk X$! X$`20def`20source`20`5B`5D,disk$freewarev20:`5Bsdl.src`5D X$`20message`20source:sdlmsg X$`20sdl/language=pascal`20source:sdlnodef,sdltypdef,sdlshr X$`20pascal/environment/noobject`20source:sdlnodef,sdltypdef,sdlshr X$`20pascal`20sdlifdl X$`20link/share`20alpha_sdlifdl/opt $ call unpack BUILD_SDLIFDL.COM;2 1769043586 "" 3 3 6 $! $ create 'f' X!+++ X!This`20software`20may`20be`20copied`20and`20distributed`20provided`20that`20t Vhis`20notice`20is X!included`20and`20no`20charge`20is`20made`20other`20than`20reasonable`20media V`20costs.`20The`20source`20is X!provided`20on`20an`20'as`20is'`20basis,`20and`20no`20warranty`20is`20either V`20given`20or`20implied.`20 X! X!No`20responsibility`20is`20accepted`20for`20any`20damage`20done`20to`20progra Vms`20or`20data`20or`20any X!other`20consequential`20loss`20caused`20either`20directly`20or`20indirectly V`20as`20a`20result`20of X!using`20this`20software.`20 X! X!I`20would`20be`20pleased`20to`20hear`20of`20any`20bugs,`20solutions,`20or`20s Vuggested`20enhancements`20at X!the`20address`20below.`20 X! X!Chris`20Sharman,`20CCA`20Stationery,`20Eastway,`20Fulwood,`20Preston,`20Lancs V,`20ENGLAND X!--- X!`20Insert`20any`20procedures`20required`20BEFORE`20executable`20statements X!`20Note`20that`20we`20are`20in`20nodisplay`20mode: X!`09It`20doesn't`20make`20any`20sense`20to`20do`20anything`20to`20do`20with`20 Vwindows`20or`20cursors. X!`09We`20can,`20however,`20output`20messages`20in`20the`20normal`20way. X!`09We`20also`20still`20have`20a`20"current`20position" X! X!`20Invoke`20with: X!`09$`20EDIT/TPU/NODISPLAY/NOSECTION/COMMAND=SYS$MANAGER:IFDL`20file X Xprocedure`20parse_module(txt,n,nam) X X`20`20`20`20local`20i,`20j,`20mytxt; X X`20`20`20`20i`20:=`20INDEX(txt,'/'); X`20`20`20`20if`20(i=0)`20then X`09message('Missing`20module`20number/name'); X`09n`20:=`200; X`09nam`20:=`20'Missing`20'+txt+'`20name'; X`20`20`20`20else X`09mytxt`20:=`20SUBSTR(txt,`20i+1,`20LENGTH(txt)-i); X`09j`20:=`20INDEX(mytxt,`20'/'); X`09if`20(j=0)`20then X`09`20`20`20`20message('Missing`20module`20name'); X`09`20`20`20`20nam`20:=`20'Missing`20'+txt+'`20name'; X`09else X`09`20`20`20`20n`20:=`20int(substr(mytxt,1,`20j-1)); X`09`20`20`20`20mytxt:=substr(mytxt,`20j+1,`20LENGTH(mytxt)); X`09`20`20`20`20i`20:=`20INDEX(mytxt,'#'); X`09`20`20`20`20if`20(i=0)`20then`20 X`09`09message("Missing`20end`20of`20comment"); X`09`09nam`20:=`20'Missing`20'+txt+'`20name'; X`09`20`20`20`20else X`09`09nam`20:=`20substr(mytxt,`201,`20i-1); X`09`20`20`20`20endif;`09`09`09 X`09endif; X`20`20`20`20endif; Xendprocedure; X Xprocedure`20remove_included_modules X X`20`20`20`20local`20sev,`20n,`20name1,`20name2,`20txt,`20pos,`20count,`20start V,`20mod,`20endmod; X X`20`20`20`20sev`20:=`201; X`20`20`20`20count`20:=`200; X`20`20`20`20mod`20:=`20'###Module/'`20+`20remain; X`20`20`20`20endmod`20:=`20'###End_Module/'`20+`20remain; X`20`20`20`20loop X`09pos`20:=`20search_quietly(mod,`20forward); X`09exitif`20pos=0; X`09txt`20:=`20str(pos); X`09position(pos); X`09position(search(line_begin,`20reverse)); X`09parse_module(txt,`20n,`20name1); X`09move_vertical(-n); X`09start`20:=`20mark(none); X`09pos`20:=`20search_quietly(endmod,`20forward); X`09if`20pos=0`20then X`09`20`20`20`20message('Missing`20End_Module`20for`20'+name1); X`09`20`20`20`20sev`20:=`202; X`09`20`20`20`20exitif`201; X`09endif; X`09txt`20:=`20str(pos); X`09position(pos); X`09position(search(line_begin,`20reverse)); X`09parse_module(txt,`20n,`20name2); X`09move_vertical(1+n); X`09if`20name1<>name2`20then X`09`20`20`20`20message('Name`20mismatch`20:`20module`20'+name1+',`20end_module V`20'+name2); X`09`20`20`20`20sev`20:=`202; X`09`20`20`20`20exitif`201; X`09endif; X`09erase(create_range(start,`20mark(none),`20none)); X`09move_vertical(-1); X`09txt`20:=`20current_line; X`09edit(txt,`20trim); X`09move_vertical(+1); X`09if`20(txt<>'')`20then`20split_line;`20endif; X`09copy_text('Copy`20"'+name1+'"`20End`20Copy'); X`09split_line; X`09txt`20:=`20current_line; X`09edit(txt,`20trim); X`09if`20(txt<>'')`20then`20split_line;`20endif; X`09count`20:=`20count`20+`201; X`20`20`20`20endloop; X`20`20`20`20message(`20fao(`20'!UL`20copy`20module!%S`20removed.',`20count)); V X`20`20`20`20if`20sev<>1`20then`20quit(off,`20sev);`20endif Xendprocedure; X Xprocedure`20replace(`20pat,`20repl`20) X X`20`20`20`20local`20pos,`20count; X X`20`20`20`20count`20:=`200; X`20`20`20`20position(beginning_of(current_buffer)); X`20`20`20`20loop X`09pos`20:=`20search_quietly(pat,`20forward); X`09exitif`20pos=0; X`09position(pos); X`09erase(pos); X`09copy_text(repl); X`09count`20:=`20count`20+`201; X`20`20`20`20endloop; X`20`20`20`20return`20count; Xendprocedure; X Xprocedure`20do_ff_and_comments X X!`20`20`20`20message(fao('!UL`20form`20feed!%S`20removed.', X`20`20`20`20replace(ascii(12),`20''); X!`20`20`20`20message(fao('!UL`20comment`20delimiter!%S`20changed.', X`20`20`20`20replace('/*',`20'`7B'); X`20`20`20`20replace('*/',`20'`7D'); Xendprocedure; X Xprocedure`20outside_string(pos,`20space) X X`20`20`20`20local`20oldpos,`20line,`20offset,`20i,`20j,`20quote; X X`20`20`20`20if`20(pos=0)`20then`20return`201;`20endif; X`20`20`20`20oldpos`20:=`20mark(none); X`20`20`20`20position(pos); X`20`20`20`20offset`20:=`20current_offset; X`20`20`20`20line`20:=`20current_line; X`20`20`20`20if`20(space)`20then X!`20Need`20to`20check`20bounded`20by`20whitespace X!`09message('Checking`20bounded`20by`20whitespace'); X`09if`20offset>0`20then X`09`20`20`20`20move_horizontal(-1); X`09`20`20`20`20if`20(current_character<>ascii(9))`20and X`09`09`20`20`20`20(current_character<>ascii(32))`20then X!`09`09message(fao('Leading`20character`20!UL',ascii(current_character))); X`09`09position(end_of(pos)); X`09`09return`200; X`09`20`20`20`20endif; X`09endif; X`09position(end_of(pos)); X`09move_horizontal(+1); X`09if`20(current_offsetascii(9))`20and X`09`09`20`20`20`20(current_character<>ascii(32))`20then X!`09`09message(fao('Trailing`20character`20!UL',ascii(current_character))); X`09`09return`200; X`09`20`20`20`20endif; X`09endif; X`20`20`20`20endif; X`20`20`20`20position(oldpos); X!`20`20`20`20message('Checking`20not`20within`20string'); X!`20Check`20not`20within`20string`20(strings`20don't`20span`20lines) X`20`20`20`20loop X`09i`20:=`20index(line,`20'"'); X`09j`20:=`20index(line,`20"'"); X`09if`20(i=0)`20and`20(j=0)`20then`20return`201;`20endif; X`09if`20(i=0)`20or`20((j>0)`20and`20(joffset)`20then`20return`201;`20endif; X`09offset`20:=`20offset`20-`20i`20-`201; X`09line`20:=`20substr(line,`20i+1,`20length(line)); X`09i`20:=`20index(line,`20quote); X`09if`20(i=0)`20or`20(i>offset)`20then X`09`20`20`20`20position(end_of(pos)); X!`09`20`20`20`20message('Within`20string`20:`20'+line); X`09`20`20`20`20return`200; X`09endif; X`09offset`20:=`20offset`20-`20i`20-`201; X`09line`20:=`20substr(line,`20i+1,`20length(line)); X`20`20`20`20endloop; Xendprocedure; X Xprocedure`20outside_comment(pos) X X`20`20`20`20local`20com,`20r,`20start; X X!`20`20`20`20message('Checking`20not`20within`20comment'); X`20`20`20`20start`20:=`20mark(none); X`20`20`20`20r`20:=`20create_range(start,`20beginning_of(pos),`20none); X`20`20`20`20loop X`09com`20:=`20search_quietly('`7B'`20`7C`20'`7D',`20reverse,`20exact,`20r); X`09exitif`20outside_string(com,`200); X`09position(beginning_of(com)); X`09move_horizontal(-1); X`09r`20:=`20create_range(start,`20mark(none),`20none); X`20`20`20`20endloop; X`20`20`20`20if`20(str(com)='`7B')`20then X`09position(pos); X`09position(search('`7D',`20forward)); X`09return`200; X`20`20`20`20else X!`09message('Checked`20not`20within`20comment'); X`09position(start); X`09return`20outside_string(pos,`201); X`20`20`20`20endif; Xendprocedure; X Xprocedure`20newpage(pos) X X`20`20`20`20position(pos); X`20`20`20`20move_horizontal(-current_offset); X`20`20`20`20move_vertical(-1); X`20`20`20`20copy_text(ascii(12)); X`20`20`20`20position(end_of(pos)); Xendprocedure; X Xprocedure`20insert_ff_every(startpat,`20endpat) X X`20`20`20`20local`20pos,`20count; X X`20`20`20`20count`20:=`200; X`20`20`20`20loop X`09pos`20:=`20search_quietly(startpat,`20forward); X`09exitif`20(pos`20=`200); X!`09message('Found`20'+str(pos)); X`09if`20outside_comment(pos)`20then X`09`20`20`20`20count`20:=`20count`20+`201; X`09`20`20`20`20newpage(pos); X`09`20`20`20`20loop X`09`09pos`20:=`20search(endpat,`20forward); X!`09`09message('End:`20'+str(pos)); X`09`09if`20outside_comment(pos)`20then X`09`09`20`20`20`20position(end_of(pos)); X`09`09`20`20`20`20exitif`201; X`09`09endif; X`09`20`20`20`20endloop; X`09endif; X`20`20`20`20endloop; X`20`20`20`20return`20count; Xendprocedure; X Xprocedure`20insert_ff X X`20`20`20`20local`20pos,`20space,`20count; X X`20`20`20`20space`20:=`20spanl(ascii(9)+'`20'); X`20`20`20`20pos`20:=`20search_quietly('form'`20+`20space`20+`20'record',`20for Vward); X`20`20`20`20if`20(pos<>0)`20then X`09newpage(pos); X!`09message('Form`20feed`20inserted`20before`20form`20records.'); X`20`20`20`20else X`09message('No`20form`20records`20found.'); X`20`20`20`20endif; X`20`20`20`20count`20:=`20insert_ff_every('layout','end'`20+`20space`20+`20'lay Vout'); X!`20`20`20`20message(fao('Form`20feed`20inserted`20before`20!UL`20layout!%S.', V`20count)); X`20`20`20`20if`20count>1`20then X`09message('***`20Warning`20-`20only`20last`20layout''s`20panels`20will`20be V`20seen.'); X!`20This`20problem`20will`20necessitate`20a`20change`20in`20the`20algorithm: X!`20Currently`20we`20process`20all`20the`20responses,`20then`20all`20panels`20 Vfrom`20the`20last`20response X!`20What`20we`20should`20do`20is`20do`20this`20within`20each`20layout X!`20So`20process`20the`20form`201`20layout`20at`20a`20time. X`20`20`20`20endif; X`20`20`20`20position(beginning_of(current_buffer)); X`20`20`20`20pos`20:=`20mark(none); X`20`20`20`20count`20:=`20insert_ff_every('enable'`20+`20space`20+`20'response' V, X`09`09`09'end'`20+`20space`20+`20'response'); X!`20`20`20`20message(fao('Form`20feed`20inserted`20before`20!UL`20enable`20res Vponse!%S.',`20count)); X`20`20`20`20if`20pos'MMS_FILE')`20then X`09`20`20`20`20mmsfile`20:=`20file_parse('mms_file',`20'.mms',`20infile); X`20`20`20`20else X`09`20`20`20`20mmsfile`20:=`20file_parse('.mms',`20infile); X`20`20`20`20endif; X`20`20`20`20if`20file_search(mmsfile)<>''`20then X`09`20`20`20`20mms_old_buffer`20:=`20create_buffer`20(`20'mms',`20mmsfile`20); V X`09`20`20`20`20mms_buffer`20:=`20create_buffer`20(`20'mms_work'`20); X`09`20`20`20`20mms_exists`20:=`201; X`09`20`20`20`20set(no_write,`20mms_buffer); X`20`20`20`20else X`09`20`20`20`20mms_old_buffer`20:=`20create_buffer`20(`20'mms'`20); X`09`20`20`20`20mms_buffer`20:=`20mms_old_buffer; X`09`20`20`20`20mms_exists`20:=`200; X`09`20`20`20`20desc_exists`20:=`200; X`20`20`20`20endif; +-+-+-+-+-+-+-+- END OF PART 4 +-+-+-+-+-+-+-+- ================== RFC 822 Headers ================== Return-Path: chris@ccastat.demon.co.uk Received: by dimond.zko.dec.com (UCX V4.0-10B, OpenVMS V6.2 VAX); Thu, 23 May 1996 11:31:50 -0400 Received: from office.demon.net by mail11.digital.com (8.7.5/UNX 1.2/1.0/WV) id LAA05873; Thu, 23 May 1996 11:19:19 -0400 (EDT) Received: from ccastat.demon.co.uk by office.demon.net id aa11600; 23 May 96 16:10 +0100 Received: by ccastat.demon.co.uk (MX V4.1 VAX) id 9; Thu, 23 May 1996 13:24:52 GMT Sender: chris@ccastat.demon.co.uk Date: Thu, 23 May 1996 13:24:51 GMT From: chris@ccagroup.co.uk Reply-To: chris@ccastat.demon.co.uk To: everhart@star.zko.dec.com, ARNE@ko.hhs.dk, canellis@apache.brooks.af.mil, SCANDORA@cmt.anl.gov Message-ID: <009A2C33.AF925C80.9@ccastat.demon.co.uk> Subject: SDLIFDL.4-OF-8