P.I. Engineering User Forum

Product Support, Technical Questions and Answers, and Examples for P.I. Engineering Products

You are not logged in.

#1 2017-04-07 14:34:49

Registered: 2017-04-05
Posts: 17

Dim {variable} declarations

I'm getting an error message: "Declaration expected" when trying to declare an array.

'=↓=↓=↓= Initialize Variables Start =↓=↓=↓=↓=↓=↓=↓=↓=[MWTAG3]
	Dim MW3 As Interfaces.MW3
	Dim MyDevice As Integer() = {1230, -1, 1} 'Device Descriptor [MWTAG8]
	Dim AppName As String = "" 'Active application name
	Dim AppTitle As String = "" 'Active application title
	Dim Layer_Red As Integer = 0 'Red,3
	Dim PreviewRow(24) As Integer
		PreviewRow(0)  = 10008
		PreviewRow(1)  = 10016

The error message starts on the first "PreviewRow(0) = 10008" and continues for every array element.

How/where do you declare an array?

Last edited by GordR (2017-04-07 14:36:06)


#2 2017-04-10 07:39:43

PIE Amber
Technical Software Developer
From: Williamston, MI
Registered: 2016-01-21
Posts: 196

Re: Dim {variable} declarations

Please declare it as:

Dim PreviewRow(24) As Integer() = {10008, 10016}

Use the same format as used for "MyDevice" right above that.

Amber from P.I. Engineering


#3 2017-04-11 17:16:44

Registered: 2017-04-05
Posts: 17

Re: Dim {variable} declarations

Thank you


Board footer

Powered by FluxBB