Blitz (177/218)

From:Nick Clover
Date:27 Aug 2001 at 16:13:21
Subject:Re: Tooltypes Libraries?

Hello David

On 27-Aug-01, you wrote:

> Howdy!

> I wish to have my program read [& eventually write]
> tooltypes. I see there are 2 libraries that deal w/ this: the New
> Command Set, & the RI set. Should i prefer either of these? Which
> is more reliable, easy to use, etc??

> Advance Thanks,

ok, here's a routine that reads tooltype info, grabbed from stats&funcs
at least it will get you started while you're deciding what library to
use.

; Function : ToolString { icon, tooltype }

; Author : James L Boyd - jamesboyd@all-hail.freeserve.co.uk
; - adapted from someone else's source!

; Returns tooltype's contents (if any)...
; or "NotFound" if not found :) - added by Nick Clover

Function.s ToolString {icon$,tool$}

If Right$(icon$,5)=".info" Then icon$=Left$(icon$,Len(icon$)-5)

*Icon.DiskObject=GetDiskObject_(&icon$)

; *Icon.DiskObject=GetDiskObjectNew_(&icon$)
; ^ this uses the default-type icon if there isn't one...

a$="NotFound"

If *Icon
a.l=FindToolType_(*Icon\do_ToolTypes,&tool$)
If a
a$=Peek$(a)
Else a$=""
EndIf
FreeDiskObject_ *Icon
Else Function Return ""
EndIf

Function Return a$
End Function

; demo :

; NOTE - you'll need to change this to something
; on your system!

; NPrint ToolString {"SYS:Tools/HDToolBox","SCSI_DEVICE_NAME"}

; MouseWait
; End

Regards






Nick Clover



A4000/060, 64Mb, PicassoIV, Paloma, KTX 17" Monitor, Punchinello II

IDE: 10.1 & 13.8 Gb HD, SCSI: Fujitsu 18Gb HD, Sony CDU625-S CD

2x Sony CDD2600 CDR, Aiwa ACD300, Ricoh 8x8x32 CDrw

Brother HL1250 Laser, HP890c Inkjet, Generic V90 Modem, Trust Ergo Keyboard


---------------------------------------------------------------------
To unsubscribe, e-mail: blitz-list-unsubscribe@netsoc.ucd.ie
For additional commands, e-mail: blitz-list-help@netsoc.ucd.ie