PlatformNotSupportedException

From Xojo Documentation
Jump to: navigation, search

Class (inherits from RuntimeException)

Raised if a method is only for a particular platform but it was called from another platform. The functions FolderItem.MacFSRef and FolderItem.CreateFromMacFSRef raise this exception if called from Windows or Linux.

Example

A PlatformNotSupportedException is raised if you call a method on Carbon that is supported only on Cocoa. For example, this example will raise an exception from a Carbon build because alpha channels are supported on Cocoa, not Carbon. You can fix this by setting the target platform in the Build Settings dialog box.

dim width as integer = 2000
dim height as integer = 2000

// creates new picture
dim pic as new Picture(width, height) //constructor for a picture with an alpha channel
dim f as FolderItem
f=GetOpenFolderItem("image/jpeg")
if f<> Nil then
pic=Picture.Open(f)
ImageWell1.Image=pic
end if
exception err as PlatformNotSupportedException
MsgBox err.message

See Also

FolderItem.CreateFromMacFSRef, FolderItem.MacFSRef, RuntimeException.

Personal tools
Namespaces

Variants
Actions
Main
Content
Starting Out
Dig Deeper
More Help
Toolbox
About