Platforms to show: All Mac Windows Linux Cross-Platform
Required plugins for this example: MBS Util Plugin
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /Util/File Length Example
This example is the version from Mon, 6th Nov 2022.
Project "File Length Example.xojo_binary_project"
FileTypes
Filetype special/any
End FileTypes
Class Window1 Inherits Window
Control StaticText1 Inherits Label
ControlInstance StaticText1 Inherits Label
End Control
Control StaticText2 Inherits Label
ControlInstance StaticText2 Inherits Label
End Control
Control StaticText3 Inherits Label
ControlInstance StaticText3 Inherits Label
End Control
Control StaticText4 Inherits Label
ControlInstance StaticText4 Inherits Label
End Control
Control StaticText5 Inherits Label
ControlInstance StaticText5 Inherits Label
End Control
Control StaticText6 Inherits Label
ControlInstance StaticText6 Inherits Label
End Control
Control Separator1 Inherits Separator
ControlInstance Separator1 Inherits Separator
End Control
Control StaticText7 Inherits Label
ControlInstance StaticText7 Inherits Label
End Control
Control StaticText8 Inherits Label
ControlInstance StaticText8 Inherits Label
End Control
Control pd Inherits Label
ControlInstance pd Inherits Label
End Control
Control ld Inherits Label
ControlInstance ld Inherits Label
End Control
Control pr Inherits Label
ControlInstance pr Inherits Label
End Control
Control lr Inherits Label
ControlInstance lr Inherits Label
End Control
Control pt Inherits Label
ControlInstance pt Inherits Label
End Control
Control pl Inherits Label
ControlInstance pl Inherits Label
End Control
Control dlen Inherits Label
ControlInstance dlen Inherits Label
End Control
Control rlen Inherits Label
ControlInstance rlen Inherits Label
End Control
EventHandler Sub DropObject(obj As DragItem, action As Integer)
do
if obj.folderItemavailable then
run obj.folderItem
end if
loop until not obj.nextItem
End EventHandler
EventHandler Sub Open()
run app.ApplicationFileMBS
me.acceptfileDrop "special/any"
End EventHandler
Sub run(f as folderItem)
if f<>nil then
pd.text=format(f.PhysicalFileDataLengthMBS,"-0")
pr.text=format(f.PhysicalFileResLengthMBS,"-0")
pt.text=format(f.PhysicalFileTotalLengthMBS,"-0")
ld.text=format(f.LogicalFileDataLengthMBS,"-0")
lr.text=format(f.LogicalFileResLengthMBS,"-0")
pl.text=format(f.LogicalFileTotalLengthMBS,"-0")
dlen.Text=Format(f.length,"-0")
#if RBVersion < 2020 then
rlen.Text=Format(f.resourceForkLength,"-0")
#EndIf
end if
End Sub
End Class
MenuBar Menu
MenuItem UntitledMenu3 = ""
MenuItem UntitledMenu2 = "File"
MenuItem FileQuit = "Quit"
MenuItem UntitledMenu7 = ""
MenuItem UntitledMenu0 = "Edit"
MenuItem EditUndo = "Undo"
MenuItem UntitledMenu1 = "-"
MenuItem EditCut = "Cut"
MenuItem EditCopy = "Copy"
MenuItem EditPaste = "Paste"
MenuItem EditClear = "Clear"
MenuItem UntitledMenu6 = ""
MenuItem UntitledMenu5 = ""
MenuItem UntitledMenu4 = ""
End MenuBar
Class App Inherits Application
End Class
End Project
See also:
The items on this page are in the following plugins: MBS Util Plugin.