dfarmernv
09-17-2007, 11:48 AM
Hi everyone, first post here.
I could use a bit of help with the dictionary object. I am trying to write two functions, one that essentially places and order and one that receives an order (this is an inventory simulation macro). My idea is to just have a dictionary called orders and placing an order will just do
orders.Add [arrival-time], [quantity]
and on the receiving end it will (basically) look at the same dictionary and say, "Is the current time, 't', equal to the arrival time, 'at', if so return quantity."
The problem is I am getting all sorts of errors. At the moment I am just getting an error 1004 "Application-defined or object defined error" which I believe is coming from the Microsoft Scripting Engine. In Declarations I have
Dim orders As New Dictionary and then in the main loop of the simulation I have Set orders = New Dictionary (I'm not really sure where to put that statement, if I put it in the place or get orders functions it will get called on every iteration...). Anyway I hope my question is intelligible, if you need more code or explanation about what I'm attempting ask away. Thank you for any clues you can provide on setting up a global dictionary.
I could use a bit of help with the dictionary object. I am trying to write two functions, one that essentially places and order and one that receives an order (this is an inventory simulation macro). My idea is to just have a dictionary called orders and placing an order will just do
orders.Add [arrival-time], [quantity]
and on the receiving end it will (basically) look at the same dictionary and say, "Is the current time, 't', equal to the arrival time, 'at', if so return quantity."
The problem is I am getting all sorts of errors. At the moment I am just getting an error 1004 "Application-defined or object defined error" which I believe is coming from the Microsoft Scripting Engine. In Declarations I have
Dim orders As New Dictionary and then in the main loop of the simulation I have Set orders = New Dictionary (I'm not really sure where to put that statement, if I put it in the place or get orders functions it will get called on every iteration...). Anyway I hope my question is intelligible, if you need more code or explanation about what I'm attempting ask away. Thank you for any clues you can provide on setting up a global dictionary.