Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Public oform1
oform1=createobject("form1")
oform1.AddObject("oleOut","out")
oform1.Show
Return
Define Class form1 As Form
Height = 352
Width = 433
DoCreate = .T.
AutoCenter = .T.
Caption = "Demo directory display"
AlwaysOnTop = .T.
Name = "Form1"
Add Object text1 As TextBox With ;
Height = 25, ;
Left = 12, ;
Top = 312, ;
Width = 265, ;
BackColor = Rgb(192,192,192), ;
Name = "Text1"
Add Object command1 As CommandButton With ;
AutoSize = .T., ;
Top = 312, ;
Left = 288, ;
Height = 27, ;
Width = 88, ;
Caption = "Get Directory", ;
Name = "Command1"
Procedure createarray
Lparameters m.path, m.nlevel, m.nCount
Local DirArr,i,nTotDir,lvl
Store 0 To i,lvl,Cnt
m.path = Alltrim(m.path)
If Parameters()<2 Or Type("m.nlevel") #"N"
lvl = 0
Else
lvl = m.nlevel
Endif
If Parameters()<2 Or Type("m.nCount") #"N"
Cnt = 0
Else
Cnt = m.nCount
Endif
lvl = lvl + 1
Cnt = Cnt + 1
o = This.oleOut
If Cnt = 1
o.AddItem(Lower(m.path))
o.Indent(Cnt-1)=1
Else
o.AddItem(Lower(m.path))
o.Indent(Cnt-1)=m.lvl
Endif
Dimension DirArr[1,1]
nTotDir=Adir(DirArr,m.path+"*.","D")
Asort(DirArr)
For i = 1 To m.nTotDir
If DirArr[m.i,1] != '.' And DirArr[m.i,1] != '..' And Atc('D',DirArr[m.i,5])#0
This.createarray(m.path+DirArr[m.i,1]+'\', m.lvl, m.cnt)
Endif
Endfor
Endproc
Procedure command1.Click
Local cDir
If Thisform.oleOut.Object.ListCount > 0
Thisform.oleOut.RemoveItem(0)
Endif
cDir = Getdir()
If Empty(m.cDir)
Return
Else
Thisform.text1.Value = m.cDir
Endif
If Thisform.oleOut.Object.ListCount>0
Thisform.cleanuP()
Endif
Thisform.createarray(m.cDir)
Endproc
Enddefine
Define Class out As OleControl
Top = 24
Left = 24
Height = 193
Width = 289
Visible = .T.
OleClass='msoutl.outline'
Enddefine