New topic: Free Disk Space Problem
<http://forums.realsoftware.com/viewtopic.php?t=47661> Page 1 of 1 [ 2 posts ] Previous topic | Next topic Author Message RicSum Post subject: Free Disk Space ProblemPosted: Sun Apr 21, 2013 1:48 pm Joined: Fri Jun 05, 2009 4:54 pm Posts: 458 Location: London, England Hi all, I have the following code which came from this forum: Declare Function GetDiskFreeSpaceExW Lib "Kernel32" (dirname As WString, ByRef freeBytesAvailable As UInt64, _ ByRef totalbytes As UInt64, ByRef totalFreeBytes As UInt64) As Integer Dim userfree, totalsize, totalfree As UInt64 Call GetDiskFreeSpaceExW(App.ExecutableFile.Parent.AbsolutePath, userfree, totalsize, totalfree) How do I get a TextField or TextArea to display the actual free space? I tried placing a TextField onto my window and used the following code: TextField1.Text = totalfree but I got an error saying "expected String but got UInt64" ? Thank you all in advance. _________________ RealStudio Professional Edition 2012 r2 Developing on OS X 10.8 (Mountain Lion) Deploying on Windows XP / 7 / 8 Top Dale Post subject: Re: Free Disk Space ProblemPosted: Sun Apr 21, 2013 2:03 pm Joined: Thu Mar 01, 2007 2:02 pm Posts: 234 Location: Sunny (generally!) Southern California Since the function returns a UInt64, you need to convert that to a string. Try TextField1.Text = str(totalfree) - Dale _________________ ----- Real Studio 2012r1 on Windows 7 (64 bit) ----- It has been said that politics is the second oldest profession. I have learned that it bears a striking resemblance to the first. - Ronald Reagan Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 2 posts ] -- Over 1500 classes with 29000 functions in one REALbasic plug-in collection. The Monkeybread Software Realbasic Plugin v9.3. http://www.monkeybreadsoftware.de/realbasic/plugins.shtml [email protected]
