# A mystery

Discussion created by Head1 on Aug 11, 2010

Hello everybody in automation room,

I try to write a simple code to build a BoardOutline + RouteOutline, when given

x, y dimensions and offset between them.

' =======================================================
Private Sub Run_but_Click()

Dim x, y, D

Dim Arr()           ' BoardOutline   array
Dim RO_Lst()    ' RouteOutline   array

ReDim Arr(2, 4)
ReDim RO_Lst(2, 4)

x = 75     ' X dimension for BoardOutline
y = 60     ' Y dimension for BoardOutline
D = 2      ' Clearance between BO and RO

'       x               y                   R
' -------------------------------------------------
Arr(0, 0) = 0: Arr(1, 0) = 0: Arr(2, 0) = 0
Arr(0, 1) = 0: Arr(1, 1) = y: Arr(2, 1) = 0
Arr(0, 2) = x: Arr(1, 2) = y: Arr(2, 2) = 0
Arr(0, 3) = x: Arr(1, 3) = 0: Arr(2, 3) = 0
Arr(0, 4) = 0: Arr(1, 4) = 0: Arr(2, 4) = 0

My_Board.PutBoardOutline 5, Arr, 0, epcbUnitCurrent     ' Works fine.

' Assigning values to RouteOutline array (RO_lst)

'       x                                            y                                         R
' --------------------------------------------------------------------------------------------------
RO_Lst(0, 0) = Arr(0, 0) + D:  RO_Lst(1, 0) = Arr(1, 0) + D:  RO_Lst(2, 0) = 0
RO_Lst(0, 1) = Arr(0, 1) + D:  RO_Lst(1, 1) = Arr(1, 1) - D:   RO_Lst(2, 1) = 0
RO_Lst(0, 2) = Arr(0, 2) - D:   RO_Lst(1, 2) = Arr(1, 2) - D:   RO_Lst(2, 2) = 0
RO_Lst(0, 3) = Arr(0, 3) - D:   RO_Lst(1, 3) = Arr(1, 3) + D:  RO_Lst(2, 3) = 0
RO_Lst(0, 4) = Arr(0, 4) + D:  RO_Lst(1, 4) = Arr(1, 4) + D:  RO_Lst(2, 4) = 0

My_Board.PutRouteBorder 5, RO_Lst, 0, epcbUnitCurrent      ' DOES NOT WORK
End Sub
' ================================================

So, the 2 "Put instructions" look the same. The first one works.

The second one does not work. Please see attached error picture.

More than this:  When I use array arr() for creating Routeoutline - IT WORKS.

When I use array RO_lst() for creating Routeoutline - IT DOES NOT WORKS,

and get the attached error.

Is there anything I do not know about RouteOutline or  had a silly error, like most of times.

Many thanks to all helpers and advisors.