WIA.DeviceCount
---------------

Queries number of devices.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [WIA](component_WIA.md) | [6.5](newinversion65.md) | ❌ No | ✅ Yes | ❌ No | ❌ No | ❌ No |

MBS( "WIA.DeviceCount" ) ### Parameters

none

### Result

Returns number or error.

### Description

Queries number of devices.  
### Examples

Walk over list of devices and query properties:

 Go to Layout \[“WIA Scan” (WIA Scan)\]  
Delete All Records \[No dialog\]  
Set Variable \[$c ; Value:MBS ("WIA.DeviceCount")\]  
If \[MBS ("IsError")\]  
 Show Custom Dialog \["Error"; $c \]  
Else  
 If \[$c &gt; 0\]  
 Set Variable \[$i ; Value:0\]  
 Loop  
 Perform Script \[“List Properties”; Parameter: $i \]  
 #Next  
 Set Variable \[$i ; Value:$i + 1\]  
 Exit Loop If \[$i &gt;= $c \]  
 End Loop  
 End If  
End If  
### See also

- [IsError](IsError.md)

### Example Databases

- [DynaPDF/Scan with WIA to PDF](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/DynaPDF/Scan%20with%20WIA%20to%20PDF.shtml#3ScriptAnchor_)
- [Win Only/Scanning/WIA Scan](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Win%20Only/Scanning/WIA%20Scan.shtml#3ScriptAnchor_)

This function checks for a license.

Created 6th November 2016 , last changed 6th November 2016

  
[WIA.ClearCurrentDevice](WIAClearCurrentDevice.md) - [WIA.DeviceProperties](WIADeviceProperties.md)

[HTML Version](WIADeviceCount.shtml)