Returning a list of available volumes

Find quick help here to get you started with Hollywood
Post Reply
djrikki
Posts: 682
Joined: Wed Apr 06, 2011 12:26 am

Returning a list of available volumes

Post by djrikki » Sun Apr 17, 2011 7:05 pm

Hi,

Here is a rather rudimentary attempt at returning available volumes. Problem is when it runs FindStr() is returning mixed values so I can't proceed. I believe its how I am stripping the data using SplitStr().

OFF-Topic: Can you swap the Save and Submit buttons around please on this forum as I am forever hitting the Save button!

Code: Select all

/*
************************************************************
**
** Created by: CodeBench 0.13 (16.02.2010)
**
** Project: DialogBox
**
** File: 
**
** Date: 17-04-2011 16:14:49
**
************************************************************
*/

Execute("assign devices >TEXTCLIP:")

type, data = GetClipboard()

devices = {}

devices, noofdevices = SplitStr(data," ")

For x = 1 to noofdevices-1
	; List Hard Drives
	Print(devices[x-1] .. "   " .. FindStr(devices[x-1],"DH",FALSE) .. "\n")
	;	Print("Hard drive found\n")
	;EndIf
Next

WaitLeftMouse
Evolve - Rapid GUI Development tool for MUI Royale and RapaGUI
http://myevolve.wordpress.com

djrikki
Posts: 682
Joined: Wed Apr 06, 2011 12:26 am

Re: Returning a list of available volumes

Post by djrikki » Sun Apr 17, 2011 7:41 pm

Nvm, came up with a solution.

I have a question though: What kind of devices are IPC, IDF and ICD?

Code: Select all

/*
************************************************************
**
** Created by: CodeBench 0.13 (16.02.2010)
**
** Project: DialogBox
**
** File: 
**
** Date: 17-04-2011 16:14:49
**
************************************************************
*/

Execute("info devices sort volume >TEXTCLIP:")

type, data = GetClipboard()

devices = {}

harddisks = {}
h = 0

optical = {}
o = 0

usb = {}
u = 0

devices, noofdevices = SplitStr(data,"\n")

For x = 1 to noofdevices-1
	line = devices[x-1]

	; List Hard Drives
	If FindStr(line,"DH",FALSE) = 0
		harddisks[h] = MidStr(line,0, FindStr(line,":"))
		h = h +1
	ElseIf FindStr(line,"CD",FALSE) = 0
		optical[o] = MidStr(line,0, FindStr(line,":"))
		o = o +1
	ElseIf FindStr(line,"USB",FALSE) = 0
		usb[u] = MidStr(line,0, FindStr(line,":"))
		u = u +1
	EndIf
Next

WaitLeftMouse
Evolve - Rapid GUI Development tool for MUI Royale and RapaGUI
http://myevolve.wordpress.com

Post Reply