> Add RecipeIndex as Long to modGlobals ~~anywhere in particular or just at bottom or anywhere?~~ I put it on the bottom and put "public" in front of it and it worked but i still get a compile error, although it almost nearly fully compiles so we are close to resolution!, I see a VARIABLE NOT DEFINED upon compile (with highlighted _cmbCTool_) on frmEditor_Item. **frmEditor_Item** ``` Option Explicit Private LastIndex As Long Private Sub ChkTwoh_Click() ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler If ChkTwoh.Value = 0 Then Item(EditorIndex).istwohander = False Else Item(EditorIndex).istwohander = True End If ' Error handler Exit Sub errorhandler: HandleError "chkTwoh", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit Sub End Sub Private Sub cmbBind_Click() ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler If EditorIndex = 0 Or EditorIndex > MAX_ITEMS Then Exit Sub Item(EditorIndex).BindType = cmbBind.ListIndex ' Error handler Exit Sub errorhandler: HandleError "cmbBind_Click", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit Sub End Sub Private Sub cmbClassReq_Click() ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler If EditorIndex = 0 Or EditorIndex > MAX_ITEMS Then Exit Sub Item(EditorIndex).ClassReq = cmbClassReq.ListIndex ' Error handler Exit Sub errorhandler: HandleError "cmbClassReq_Click", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit Sub End Sub Private Sub cmbSound_Click() ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler If cmbSound.ListIndex >= 0 Then Item(EditorIndex).sound = cmbSound.List(cmbSound.ListIndex) Else Item(EditorIndex).sound = "None." End If ' Error handler Exit Sub errorhandler: HandleError "cmdSound_Click", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit Sub End Sub Private Sub cmbTool_Click() ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler If EditorIndex = 0 Or EditorIndex > MAX_ITEMS Then Exit Sub Item(EditorIndex).Data3 = cmbTool.ListIndex ' Error handler Exit Sub errorhandler: HandleError "cmbTool_Click", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit Sub End Sub Private Sub cmdDelete_Click() Dim tmpIndex As Long ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler If EditorIndex = 0 Or EditorIndex > MAX_ITEMS Then Exit Sub ClearItem EditorIndex tmpIndex = lstIndex.ListIndex lstIndex.RemoveItem EditorIndex - 1 lstIndex.AddItem EditorIndex & ": " & Item(EditorIndex).Name, EditorIndex - 1 lstIndex.ListIndex = tmpIndex ItemEditorInit ' Error handler Exit Sub errorhandler: HandleError "cmdDelete_Click", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit Sub End Sub Private Sub Form_Load() ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler scrlPic.max = numitems scrlAnim.max = MAX_ANIMATIONS scrlPaperdoll.max = NumPaperdolls ' Error handler Exit Sub errorhandler: HandleError "Form_Load", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit Sub End Sub Private Sub cmdSave_Click() ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler Call ItemEditorOk ' Error handler Exit Sub errorhandler: HandleError "cmdSave_Click", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit Sub End Sub Private Sub cmdCancel_Click() ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler Call ItemEditorCancel ' Error handler Exit Sub errorhandler: HandleError "cmdCancel_Click", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit Sub End Sub Private Sub cmbType_Click() ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler If EditorIndex = 0 Or EditorIndex > MAX_ITEMS Then Exit Sub If (cmbType.ListIndex >= ITEM_TYPE_WEAPON) And (cmbType.ListIndex MAX_ITEMS Then Exit Sub lblAccessReq.Caption = "Access Req: " & scrlAccessReq.Value Item(EditorIndex).AccessReq = scrlAccessReq.Value ' Error handler Exit Sub errorhandler: HandleError "scrlAccessReq_Change", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit Sub End Sub Private Sub scrlAddHp_Change() ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler lblAddHP.Caption = "Add HP: " & scrlAddHp.Value Item(EditorIndex).AddHP = scrlAddHp.Value ' Error handler Exit Sub errorhandler: HandleError "scrlAddHP_Change", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit Sub End Sub Private Sub scrlAddMp_Change() ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler lblAddMP.Caption = "Add MP: " & scrlAddMP.Value Item(EditorIndex).AddMP = scrlAddMP.Value ' Error handler Exit Sub errorhandler: HandleError "scrlAddMP_Change", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit Sub End Sub Private Sub scrlAddExp_Change() ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler lblAddExp.Caption = "Add Exp: " & scrlAddExp.Value Item(EditorIndex).AddEXP = scrlAddExp.Value ' Error handler Exit Sub errorhandler: HandleError "scrlAddExp_Change", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit Sub End Sub Private Sub scrlAnim_Change() Dim sString As String ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler If EditorIndex = 0 Or EditorIndex > MAX_ITEMS Then Exit Sub If scrlAnim.Value = 0 Then sString = "None" Else sString = Trim$(Animation(scrlAnim.Value).Name) End If lblAnim.Caption = "Anim: " & sString Item(EditorIndex).Animation = scrlAnim.Value ' Error handler Exit Sub errorhandler: HandleError "scrlAnim_Change", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit Sub End Sub Private Sub scrlDamage_Change() ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler If EditorIndex = 0 Or EditorIndex > MAX_ITEMS Then Exit Sub lblDamage.Caption = "Damage: " & scrlDamage.Value Item(EditorIndex).Data2 = scrlDamage.Value ' Error handler Exit Sub errorhandler: HandleError "scrlDamage_Change", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit Sub End Sub Private Sub scrlFishing_Change() ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler lblFishing.Caption = "Fishing: " & scrlFishing.Value Item(EditorIndex).FXP = scrlFishing.Value ' Error handler Exit Sub errorhandler: HandleError "scrlFishing_Change", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit Sub End Sub Private Sub scrlLevelReq_Change() ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler If EditorIndex = 0 Or EditorIndex > MAX_ITEMS Then Exit Sub lblLevelReq.Caption = "Level req: " & scrlLevelReq Item(EditorIndex).LevelReq = scrlLevelReq.Value ' Error handler Exit Sub errorhandler: HandleError "scrlLevelReq_Change", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit Sub End Sub Private Sub scrlMining_Change() ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler lblMining.Caption = "Mining: " & scrlMining.Value Item(EditorIndex).MXP = scrlMining.Value ' Error handler Exit Sub errorhandler: HandleError "scrlMining_Change", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit Sub End Sub Private Sub scrlPaperdoll_Change() ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler If EditorIndex = 0 Or EditorIndex > MAX_ITEMS Then Exit Sub lblPaperdoll.Caption = "Paperdoll: " & scrlPaperdoll.Value Item(EditorIndex).Paperdoll = scrlPaperdoll.Value ' Error handler Exit Sub errorhandler: HandleError "scrlPaperdoll_Change", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit Sub End Sub Private Sub scrlPic_Change() ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler If EditorIndex = 0 Or EditorIndex > MAX_ITEMS Then Exit Sub lblPic.Caption = "Pic: " & scrlPic.Value Item(EditorIndex).Pic = scrlPic.Value ' Error handler Exit Sub errorhandler: HandleError "scrlPic_Change", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit Sub End Sub Private Sub scrlPrice_Change() ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler If EditorIndex = 0 Or EditorIndex > MAX_ITEMS Then Exit Sub lblPrice.Caption = "Price: " & scrlPrice.Value Item(EditorIndex).Price = scrlPrice.Value ' Error handler Exit Sub errorhandler: HandleError "scrlPrice_Change", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit Sub End Sub Private Sub scrlRarity_Change() ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler If EditorIndex = 0 Or EditorIndex > MAX_ITEMS Then Exit Sub lblRarity.Caption = "Rarity: " & scrlRarity.Value Item(EditorIndex).Rarity = scrlRarity.Value ' Error handler Exit Sub errorhandler: HandleError "scrlRarity_Change", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit Sub End Sub Private Sub scrlSpeed_Change() ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler If EditorIndex = 0 Or EditorIndex > MAX_ITEMS Then Exit Sub lblSpeed.Caption = "Speed: " & scrlSpeed.Value / 1000 & " sec" Item(EditorIndex).speed = scrlSpeed.Value ' Error handler Exit Sub errorhandler: HandleError "scrlSpeed_Change", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit Sub End Sub Private Sub scrlStatBonus_Change(Index As Integer) Dim text As String ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler Select Case Index Case 1 text = "+ Str: " Case 2 text = "+ End: " Case 3 text = "+ Int: " Case 4 text = "+ Agi: " Case 5 text = "+ Will: " End Select lblStatBonus(Index).Caption = text & scrlStatBonus(Index).Value Item(EditorIndex).Add_Stat(Index) = scrlStatBonus(Index).Value ' Error handler Exit Sub errorhandler: HandleError "scrlStatBonus_Change", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit Sub End Sub Private Sub scrlStatReq_Change(Index As Integer) Dim text As String ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler Select Case Index Case 1 text = "Str: " Case 2 text = "End: " Case 3 text = "Int: " Case 4 text = "Agi: " Case 5 text = "Will: " End Select lblStatReq(Index).Caption = text & scrlStatReq(Index).Value Item(EditorIndex).Stat_Req(Index) = scrlStatReq(Index).Value ' Error handler Exit Sub errorhandler: HandleError "scrlStatReq_Change", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit Sub End Sub Private Sub scrlSpell_Change() ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler If EditorIndex = 0 Or EditorIndex > MAX_ITEMS Then Exit Sub If Len(Trim$(Spell(scrlSpell.Value).Name)) > 0 Then lblSpellName.Caption = "Name: " & Trim$(Spell(scrlSpell.Value).Name) Else lblSpellName.Caption = "Name: None" End If lblSpell.Caption = "Spell: " & scrlSpell.Value Item(EditorIndex).Data1 = scrlSpell.Value ' Error handler Exit Sub errorhandler: HandleError "scrlSpell_Change", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit Sub End Sub Private Sub scrlWoodcutting_Change() ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler lblWoodcutting.Caption = "Woodcuting: " & scrlWoodcutting.Value Item(EditorIndex).WcXP = scrlWoodcutting.Value ' Error handler Exit Sub errorhandler: HandleError "scrlWoodcutting_Change", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit Sub End Sub Private Sub txtDesc_Change() ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler If EditorIndex = 0 Or EditorIndex > MAX_ITEMS Then Exit Sub Item(EditorIndex).Desc = txtDesc.text ' Error handler Exit Sub errorhandler: HandleError "txtDesc_Change", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit Sub End Sub Private Sub txtName_Validate(Cancel As Boolean) Dim tmpIndex As Long ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler If EditorIndex = 0 Or EditorIndex > MAX_ITEMS Then Exit Sub tmpIndex = lstIndex.ListIndex Item(EditorIndex).Name = Trim$(txtName.text) lstIndex.RemoveItem EditorIndex - 1 lstIndex.AddItem EditorIndex & ": " & Item(EditorIndex).Name, EditorIndex - 1 lstIndex.ListIndex = tmpIndex ' Error handler Exit Sub errorhandler: HandleError "txtName_Validate", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit Sub End Sub ' projectile Private Sub scrlProjectileDamage_Change() ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler If EditorIndex = 0 Or EditorIndex > MAX_ITEMS Then Exit Sub lblProjectileDamage.Caption = "Damage: " & scrlProjectileDamage.Value Item(EditorIndex).ProjecTile.Damage = scrlProjectileDamage.Value ' Error handler Exit Sub errorhandler: HandleError "scrlProjectilePic_Change", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit Sub End Sub ' projectile Private Sub scrlProjectilePic_Change() ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler If EditorIndex = 0 Or EditorIndex > MAX_ITEMS Then Exit Sub lblProjectilePic.Caption = "Pic: " & scrlProjectilePic.Value Item(EditorIndex).ProjecTile.Pic = scrlProjectilePic.Value ' Error handler Exit Sub errorhandler: HandleError "scrlProjectilePic_Change", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit Sub End Sub ' ProjecTile Private Sub scrlProjectileRange_Change() ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler If EditorIndex = 0 Or EditorIndex > MAX_ITEMS Then Exit Sub lblProjectileRange.Caption = "Range: " & scrlProjectileRange.Value Item(EditorIndex).ProjecTile.Range = scrlProjectileRange.Value ' Error handler Exit Sub errorhandler: HandleError "scrlProjectileRange_Change", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit Sub End Sub ' projectile Private Sub scrlProjectileSpeed_Change() ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler If EditorIndex = 0 Or EditorIndex > MAX_ITEMS Then Exit Sub lblProjectileSpeed.Caption = "Speed: " & scrlProjectileSpeed.Value Item(EditorIndex).ProjecTile.speed = scrlProjectileSpeed.Value ' Error handler Exit Sub errorhandler: HandleError "scrlRarity_Change", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit Sub End Sub Private Sub scrlItem1_Change() If scrlItem1.Value > 0 Then lblItem1.Caption = "Item: " & Trim$(Item(scrlItem1.Value).Name) Else lblItem1.Caption = "Item: None" End If Item(EditorIndex).Recipe(RecipeIndex) = scrlItem1.Value End Sub Private Sub scrlItemNum_Change() RecipeIndex = scrlItemNum.Value lblItemNum.Caption = "Item: " & RecipeIndex scrlItem1.Value = Item(EditorIndex).Recipe(RecipeIndex) End Sub Private Sub scrlResult_Change() If scrlResult.Value > 0 Then lblResult.Caption = "Result: " & Trim$(Item(scrlResult.Value).Name) Else lblResult.Caption = "Result: None" End If Item(EditorIndex).Data3 = scrlResult.Value End Sub Private Sub scrlSmithReq_Change() ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler If EditorIndex = 0 Or EditorIndex > MAX_ITEMS Then Exit Sub lblSmith.Caption = "SM: " & scrlSmithReq Item(EditorIndex).SmithReq = scrlSmithReq.Value ' Error handler Exit Sub errorhandler: HandleError "scrlSmithReq_Change", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit Sub End Sub Private Sub scrlEnchantReq_Change() ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler If EditorIndex = 0 Or EditorIndex > MAX_ITEMS Then Exit Sub lblEnchants.Caption = "EN: " & scrlEnchantReq Item(EditorIndex).EnchantReq = scrlEnchantReq.Value ' Error handler Exit Sub errorhandler: HandleError "scrlSwordReq_Change", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit Sub End Sub Private Sub scrlAlchemyReq_Change() ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler If EditorIndex = 0 Or EditorIndex > MAX_ITEMS Then Exit Sub lblAlchemy.Caption = "Cook: " & scrlAlchemyReq Item(EditorIndex).AlchemyReq = scrlAlchemyReq.Value ' Error handler Exit Sub errorhandler: HandleError "scrlAlchemyReq_Change", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit Sub End Sub Private Sub chkAL_Click() ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler If EditorIndex = 0 Or EditorIndex > MAX_ITEMS Then Exit Sub Item(EditorIndex).Alchemist = chkAL.Value ' Error handler Exit Sub errorhandler: HandleError "chkAL_Click", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit Sub End Sub Private Sub chkEN_Click() ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler If EditorIndex = 0 Or EditorIndex > MAX_ITEMS Then Exit Sub Item(EditorIndex).Enchanter = chkEN.Value ' Error handler Exit Sub errorhandler: HandleError "chkEN_Click", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit Sub End Sub Private Sub chkSM_Click() ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler If EditorIndex = 0 Or EditorIndex > MAX_ITEMS Then Exit Sub Item(EditorIndex).Smithy = chkSM.Value ' Error handler Exit Sub errorhandler: HandleError "chkSM_Click", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.Clear Exit Sub End Sub Private Sub cmbCTool_Click() If EditorIndex = 0 Or EditorIndex > MAX_ITEMS Then Exit Sub Item(EditorIndex).Tool = cmbCTool.ListIndex End Sub ```