![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Is there a format command or some kind of formatting for a basic program? |
#3
| |||
| |||
|
|
Is there a format command or some kind of formatting for a basic program? This MD item called 'F' executes the formatter below |
#4
| |||
| |||
|
|
I think what you are looking for is the BLIST or B/List command. One, iirc, was a verb and the other was a Pick Basic program. Both had options for printing and, I believe, writing the program back into the library file. One or the other should be available on your system. If not, the PB version is pretty much "public domain" so I guess we could post it here if you needs it. |
#5
| |||
| |||
|
|
I think what you are looking for is the BLIST or B/List command. One, iirc, was a verb and the other was a Pick Basic program. Both had options for printing and, I believe, writing the program back into the library file. One or the other should be available on your system. If not, the PB version is pretty much "public domain" so I guess we could post it here if you needs it. Mark Brown "MVGuru" wrote Is there a format command or some kind of formatting for a basic program? |
#6
| |||
| |||
|
|
No offense Theo, but I don't know if I'd use a moniker like MVGuru to post a noob question like this. From someone named MVGuru I'd expect something more like... |
#7
| |||
| |||
|
|
"MVGuru" <theo (AT) violetvortex (DOT) com> wrote in message news:1134432201.465082.246160 (AT) f14g2000cwb (DOT) googlegroups.com... Is there a format command or some kind of formatting for a basic program? This MD item called 'F' executes the formatter below The syntax from TCL is: :F BASIC.PROGRAM.NAME <enter 001 PQ 002 HFORMAT.PROG 003 P FORMAT.PROG 001 * COPYRIGHT 1985/1998 - RICHARD GINSBURG 002 * ALL RIGHTS RESERVED 003 * COMPASS - RELEASE 7.7 004 * This Program embodies confidential information proprietary to 005 * Richard Ginsburg and shall not be reproduced, copied, disclosed, or 006 * transferred in any manner except under written agreement executed by 007 * Richard Ginsburg. This program is an unpublished work fully 008 * protected by the United States copyright laws and is considered a trade 009 * secret of Richard Ginsburg. 010 PROCREAD KEY ELSE STOP 011 KEY=TRIM(FIELD(KEY,' ',2)) 012 EQU BELL TO CHAR(7),FM TO CHAR(254) 013 PROMPT '' 014 FILE='PROG-LIB' 015 OPEN FILE TO F.FILE ELSE 016 PRINT;PRINT;PRINT "Cannot open '":FILE:"' file. Hit ENTER>":;INPUT A,2 017 STOP 018 END 019 READV TEST FROM F.FILE,KEY,1 ELSE STOP 020 SP=6;ID=3;SPX=6;CFLG=0;BFR=0;LINE.NO=0 021 LOOP 022 LINE.NO=LINE.NO+1 023 READV LN FROM F.FILE,KEY,LINE.NO ELSE LN='' 024 UNTIL LN='' DO 025 GOSUB 1000 026 LABEL='';L=1;X=LN 'R#5' 027 IF NUM(LN[1,1]) THEN 028 LOOP 029 L=L+1 030 WHILE NUM(LN[L,1]) DO 031 REPEAT 032 LABEL=LN[1,L-1] 033 LN=LN[L,32767] 034 GOSUB 1000 035 END 036 CMND=FIELD(LN,' ',1) 037 BEGIN CASE 038 CASE LN[1,1]='*' OR LN[1,1]='!' OR LN[1,3]='REM' 039 SPX=0 040 CASE (CMND='FOR' AND INDEX(LN,'NEXT',1)=0) OR CMND='BEGIN' OR CMND='LOOP' 041 IF CMND='LOOP' AND X='EPEAT' THEN NULL ELSE SP=SP+3 042 IF CMND='BEGIN' THEN BFR=0 043 CASE CMND='CASE' 044 IF BFR THEN 045 IF CFLG THEN 046 SPX=SPX-ID;SP=SPX;CFLG=0 047 END 048 END ELSE 049 BFR=1;CFLG=0 050 END 051 IF INDEX(LN,';',1) AND NOT(INDEX(LN,'*',1)) AND NOT(INDEX(LN,'REM',1)) AND NOT(INDEX(LN,'!',1)) THEN NULL ELSE SP=SP+3 052 CASE CMND='END' OR CMND='NEXT' OR CMND='WHILE' OR CMND='UNTIL' OR CMND='REPEAT' 053 SPX=SPX-ID 054 IF (CMND='END' AND X#' ELSE') OR X='EPEAT' OR CMND='NEXT' THEN SP=SPX 055 IF X=' CASE' THEN 056 IF CFLG THEN 057 CFLG=0;SPX=SPX-ID 058 END 059 SP=SPX 060 END 061 CASE X=' THEN' OR X=')THEN' OR X='>THEN' OR X=' ELSE' OR X=')ELSE' OR X='>ELSE' 062 SP=SP+ID 063 CASE 1;IF BFR THEN CFLG=1 ELSE CLFG=0 064 END CASE 065 NEW.LINE=LABEL:STR(' ',SPX-LEN(LABEL)):LN 066 PRINT NEW.LINE 067 WRITEV NEW.LINE ON F.FILE,KEY,LINE.NO 068 SPX=SP 069 REPEAT 070 STOP 071 1000* SUBROUTINE TO TRIM FRONT AND BACK OF LINE 072 * 073 LOOP UNTIL LN[1,1]#" " DO 074 LN=LN[2,32767] 075 REPEAT 076 LOOP UNTIL LN[LEN(LN),1]#" " DO 077 LN=LN[1,LEN(LN)-1] 078 REPEAT 079 RETURN 080 END Wow; |
#8
| |||
| |||
|
|
Is there a format command or some kind of formatting for a basic program? |
#9
| |||
| |||
|
|
This MD item called 'F' executes the formatter below The syntax from TCL is: :F BASIC.PROGRAM.NAME <enter 001 PQ 002 HFORMAT.PROG 003 P FORMAT.PROG 001 * COPYRIGHT 1985/1998 - RICHARD GINSBURG 002 * ALL RIGHTS RESERVED [snip] 007 * Richard Ginsburg. This program is an unpublished work fully 008 * protected by the United States copyright laws and is considered a trade 009 * secret of Richard Ginsburg. 010 PROCREAD KEY ELSE STOP 011 KEY=TRIM(FIELD(KEY,' ',2)) [snip] |
#10
| |||
| |||
|
|
[snip] This MD item called 'F' executes the formatter below The syntax from TCL is: F BASIC.PROGRAM.NAME <enter 001 PQ 002 HFORMAT.PROG 003 P FORMAT.PROG 001 * COPYRIGHT 1985/1998 - RICHARD GINSBURG 002 * ALL RIGHTS RESERVED [snip] 007 * Richard Ginsburg. This program is an unpublished work fully 008 * protected by the United States copyright laws and is considered a trade 009 * secret of Richard Ginsburg. 010 PROCREAD KEY ELSE STOP 011 KEY=TRIM(FIELD(KEY,' ',2)) [snip] 'PROCREAD'??!!?? Kill the PROC die PROC die!!! (pounding the keyboard) - consider using 'SENTENCE' (or equivalent) command at top of prog and cataloging the compiled code. ex newvalue=SENTENCE() IF INDEX(newvalue," ",2) THEN [snip] |
![]() |
| Thread Tools | |
| Display Modes | |
| |