; ************************************* ; ; ToolType example file for Pure Basic ; ; © 1999 - Fantaisie Software - ; ; ************************************* ; This example show almost everything ; that could be done on ToolTypes. ; ; It examins all standard Commodities ; for WB3.0 Dim commodity.s(7) commodity(0)="AutoPoint" commodity(1)="CrossDos" commodity(2)="FKey" commodity(3)="Blanker" commodity(4)="Exchange" commodity(5)="MouseBlanker" commodity(6)="ClickToFront" commodity(7)="NoCapsLock" Dim ToolArray.s(3) ToolArray(0)="Amiga1=1000" ToolArray(1)="Amiga2=2000" ToolArray(2)="Amiga3=3000" ToolArray(3)="Amiga4=4000" path$="SYS:Tools/Commodities/" tool$="CX_POPUP" If InitToolType(0,0) ;* calling this function is really a must NPrint("") For c.w=0 To 7 If ReadToolTypeDiskInfo(0,path$+commodity(c)) ;* initialize Object 0 nrtools=GetNumberOfToolTypes(0) ;* get the number of ToolTypes ;* from Object 0 If nrtools >= 0 Print(">> "+commodity(c)+" << have ") PrintNum(nrtools + 1) NPrint(" ToolTypes.") If MatchToolType(0,tool$,"") >= 0 ;* see if ToolType CX_POPUP exists NPrint("CX_POPUP is present.") Else NPrint("CX_POPUP is not present.") EndIf Str$=GetToolTypeValue(0,"CX_POPKEY") ;* see if ToolType CX_POPKEY If Str$ <> "" ;* exists and if it does get NPrint("CX_POPKEY is set to "+Str$) ;* the value Else NPrint("CX_POPKEY is not present.") EndIf NPrint("") NPrint("Here is all ToolTypes from top to bottom.") For x=0 To nrtools ToolStr$=GetNextToolTypeString(0) ;* get the next ToolType Print(ToolStr$) If MatchToolTypeString(ToolStr$,"CX_POPUP","") >= 0 ;* see if the NPrint(" << Okey, here is CX_POPUP.") ;* string holds Else ;* ToolType CX_POPUP NPrint("") EndIf Next x Else NPrint(">> "+commodity(c)+" << have no ToolTypes at all.") EndIf NPrint("") If c = 7 If WriteToolTypeDiskInfo(0,ToolArray(),"ram:Test") ;* write the last NPrint("Test.info was succesfuly writed to RamDisk.") ;* info file EndIf ;* to ramdisk with new ToolTypes EndIf FreeToolType(0) ;* free Object 0 Else NPrint("Can't find >> "+commodity(c)+" <<") EndIf NPrint("") NPrint("Press LMB to Continue...") MouseWait() : NPrint("") Next c EndIf NPrint("End of Program.")