Tracker Training Script Key 2

Sub OnMouseUp(x As Long, y As Long, flags As Long)

Dim itemid As String

Dim model as String

Dim item As New prtItem

For i = 1 To 10

'Prompt user for item id and model

'itemid = InputBox$("Enter BLOCK item id, please","Item ID Entry","")

'model = InputBox$("Enter BLOCK model type, please (valid entries: 25,36,60,99)","Model Type Entry","")

'Random generate item id and model type

Randomize

Number = Random(1,5000)

itemid = "B" & Number

If (number Mod 4) = 0 Then

model = "25"

ElseIf (number Mod 4) = 1 Then

model = "36"

ElseIf (number Mod 4) = 2 Then

model = "60"

Else

model = "99"

End If

'Set the item properties

item.regionid="SCHEDULE"

item.itemid = itemid

item.itemtypeid = model

item.regionloc = -1

item.exthold 0

item.groupid = "MAIN"

item.inthold 0

'Add the item to PRT

item.Add

Next i

Dim Region As New PrtRegion

Region.Id = "SCHEDULE"

A1$ = "CUST ORDER #"

A2$ = "COLOR"

A3$ = "CPU SER #"

A4$ = "BASE PLATFORM"

A5$ = "DRIVE HOUSING"

A6$ = "SUB_ASSEMBLY A"

A7$ = "SUB_ASSEMBLY B"

A8$ = "ASSEMBLY HOUSING"

A9$ = "POWER SUPPLY"

A10$ = "PROD START TIME"

A11$ = "AUTOCELL MACHINE"

A12$ = "AUTOCELL TEMP"

A13$ = "AUTOCELL PRESS"

A14$ = "AUTOCELL TIME"

A15$ = "CD_ROM"

A16$ = "MANUALS"

A17$ = "WARRANTY"

A18$ = "PACK TIME"

value$ = " "

Region.GetItemList

j=0

for j = 0 to Region.ItemCount - 1

'***Random cust. order numbers and colors************************************

Order$ = " "

Color$ = " "

Randomize

Number = Random(5000,9999)

Order$ = Number

If (Number Mod 3) = 0 Then

Color$ = "RED"

ElseIf (Number Mod 3) = 1 Then

Color$ = "GREEN"

Else

Color$ = "BLUE"

End If

'***End Random generation*************************************************

Region.Item(j).SetAttr A1$, Order$

Region.Item(j).SetAttr A2$, Color$

Region.Item(j).SetAttr A3$, value$

Region.Item(j).SetAttr A4$, value$

Region.Item(j).SetAttr A5$, value$

Region.Item(j).SetAttr A6$, value$

Region.Item(j).SetAttr A7$, value$

Region.Item(j).SetAttr A8$, value$

Region.Item(j).SetAttr A9$, value$

Region.Item(j).SetAttr A10$, value$

Region.Item(j).SetAttr A11$, value$

Region.Item(j).SetAttr A12$, value$

Region.Item(j).SetAttr A13$, value$

Region.Item(j).SetAttr A14$, value$

Region.Item(j).SetAttr A15$, value$

Region.Item(j).SetAttr A16$, value$

Region.Item(j).SetAttr A17$, value$

Region.Item(j).SetAttr A18$, value$

Region.Item(j).Modify

Next j

End Sub

More information