Category : Files from Magazines
Archive   : VOL9N19.ZIP
Filename : FIELD_LE.PRG

 
Output of file : FIELD_LE.PRG contained in archive : VOL9N19.ZIP

* FIELD_LEN.PRG - MAX LENGTH OF CHARACTER VARIABLES - D. Chambless
SET TALK OFF
CLOSE DATABASES
SELECT 1
USE FAT_FILE
COPY STRUCTURE EXTENDED TO TEMP
SELECT 2
USE TEMP
SET FILTER TO FIELD_TYPE = 'C'
GO TOP
NO_CVAR = 0
DO WHILE .NOT. EOF()
NO_CVAR = NO_CVAR + 1
NSTR = IIF(NO_CVAR < 10, STR(NO_CVAR,1), STR(NO_CVAR,2))
NAM_CVAR&NSTR = TRIM(FIELD_NAME)
LEN_CVAR&NSTR = 0
SKIP
ENDDO VAR
TOO_MANY = NO_CVAR
SELECT 1
GO TOP
DO WHILE .NOT. EOF()
NO_CVAR = 0
DO WHILE NO_CVAR < TOO_MANY
NO_CVAR = NO_CVAR + 1
NSTR = IIF(NO_CVAR < 10, STR(NO_CVAR,1), STR(NO_CVAR,2))
FIELD = NAM_CVAR&NSTR
LEN_CVAR&NSTR = MAX(LEN_CVAR&NSTR, LEN(LTRIM(TRIM(&FIELD))))
ENDDO VAR
SKIP
ENDDO EOF
SET PRINT ON
NO_CVAR = 0
DO WHILE NO_CVAR < TOO_MANY
NO_CVAR = NO_CVAR + 1
NSTR = IIF(NO_CVAR < 10, STR(NO_CVAR,1), STR(NO_CVAR,2))
? NAM_CVAR&NSTR, STR(LEN_CVAR&NSTR,5)
ENDDO VAR
SET PRINT OFF
EJECT
CLOSE DATABASES
ERASE TEMP.DBF
RETURN




  3 Responses to “Category : Files from Magazines
Archive   : VOL9N19.ZIP
Filename : FIELD_LE.PRG

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/