Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Dir command too wide
Message
From
10/12/2004 14:12:37
 
 
To
10/12/2004 10:36:10
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00968296
Message ID:
00968371
Views:
8
Hi Darrell,

many years ago I made this function which I called LISTSTRU as a replacement for LIST STRUCTURE, I always keep it my developmement procedure file. You can easily modify it yourself into a LISTDIR, with the help of ADIR() or FILER.DLL.
FUNCTION LISTSTRU
  LPARAMETERS lcFile
  Local lcVar,lcFiletemp,lcSelect,lcOriginal
  lcSelect=Select()
  lcFiletemp=SUBSTR(SYS(2015), 3)
  lcOriginal=ALIAS()
  IF !VARTYPE(lcFile)='L'
    IF !FILE(lcFile+'.DBF')
       =MESSAGEBOX(lcFile+'.DBF does not exist!')
       RETURN
    ELSE
      SELECT 0
      USE (lcFile) AGAIN SHARED
    ENDIF
  ELSE
    IF EMPTY(DBF())
      =MESSAGEBOX('No file in use!')
      RETURN
    ELSE
      SELECT 0
      USE (lcOriginal) AGAIN SHARED
    ENDIF
  ENDIF
  lcVar=JUSTSTEM(DBF())
  LIST STRU TO FILE (lcFiletemp) NOCONSOLE
  USE
  CREATE CURSOR curstemp (Pos n(5), Dummy1 c(2), Name c(16), Type c(20), Width n(5), Dec n(7), Dummy2 c(5),;
    Index c(6), Collate c(11),Nullz c(2))
  APPEND FROM (lcFiletemp) SDF for pos>0
  ERAS (lcFiletemp+'.TXT')
  GO TOP
  BROW LAST NOEDIT NOAPPEND NODELETE TITLE 'Structure of '+lcVar ;
    Fields Pos, Name, Type, Width, Dec:P='@Z 9',Index,Collate,Nulls=IIF( Nullz='No',.F. ,.T. )
  IF !EMPTY(lcOriginal)
    SELECT (lcOriginal)
  ELSE
    SELECT (lcSelect)
  ENDIF
  USE IN CURSTEMP
RETURN
NB! I did not include much error handling... :-)

>Anyone know how to get the DIR command to NOT wrap around to the next line? There are just too many spaces between columns. I have a similar issue with the DISPLAY STRUCTURE and LIST commands, etc. They are essentially useless commands simply because of the unnecessarily wide column spacing.
Previous
Reply
Map
View

Click here to load this message in the networking platform