vpoon Posted July 26, 2010 Report Share Posted July 26, 2010 Hi I just recently discovered this wonderful program but have hit a major roadblock. I'm trying to fill a form using a CSV so each time it is submitted a new row of info from the csv is entered. I've looked through the video tutorial and the forums but still struggling to define the variables found here. So far I understand each column in a row needs to be given a different name such as T1,T2,T3 and after each loop the data pulled will be from the next row. Any help would be much appreciated or perhaps someone has an example. Quote Link to comment Share on other sites More sharing options...
paul Posted July 26, 2010 Report Share Posted July 26, 2010 ASCII File Begin Process: "xx" (Comma Delimited Text (.csv)) ... ASCII File End Process The 3 dots in the above example represent code you write to process the contents of the T variable, i.e. %t[1]% contains the first value of your .csv file, %t[2]% contains the 2nd value, etc. Each time your ... code is executed, MEP moves to the next row in your file. Thus, in your code, you need to display your form each time as if for the 1st time - if you have 10 rows of 5 values in your .csv file, then your form will be displayed 10 times, and you will be using variables %t[1]% through %t[5]%. You will need to insert code to detect when your form is closed each time (use a Repeat command to test when your form window has been closed) so that you can process the edited values (if applicable), and then have MEP display the next row of data. Quote Link to comment Share on other sites More sharing options...
vpoon Posted July 26, 2010 Author Report Share Posted July 26, 2010 Thanks for your reply Paul. That part I understood but the area which I'm having issues with is choosing how the variables are defined (I hope I'm using the right terminology). In other words I have no clue how to fill this section out as seen in the image --> Thus far I've set the following as.... Begin processing on record: 1 Variable array to receive results: T1,T2,T3,T4 etc However, what do I set for the properties for the above variables and do I need more variables? Quote Link to comment Share on other sites More sharing options...
kevin Posted July 26, 2010 Report Share Posted July 26, 2010 Create a variable to hold the array. When prompted to create the variable choose the number of elements. You may want to use a variable other than 'T' (T[1] .. T[9]), one that has meaning to you. Perhaps something like InputData. You can create the new variable by typing %InputData% into the 'Variable array to receive result:' field. Then when you click the OK button you will be asked if you want to create it. Click Yes, and then when the Variable Properties dialog comes up, click in the Create as an array and enter the number of Elements. Quote Link to comment Share on other sites More sharing options...
lemming Posted July 27, 2010 Report Share Posted July 27, 2010 Yes, it can be slightly confusing if you've never used this before, or if you were formerly an ME3 user. I would second Kevin's suggestion to avoid using the T variable. So, if you set %InputData% as the "Variable array to receive result", the command will automatically create an array of numbered variables and fill them with each respective line from the file, i.e. Line 1 will go into %InputData[1]%, Line 2 into %InputData[2]%, Line 3 into %InputData[3]%, and so on. You do not have create those numbered variables yourself. However, you do need to define %InputData% as an array. The first time you create a variable you should get a warning prompt saying "Variable currently not defined? Create now?" or similar. Click Yes, and in the variable properties box, make sure the "Create as an array" box is checked. In the Elements box, set a sufficiently large number. This needs to be slightly larger than the number of records you will process. -Lemming Thanks for your reply Paul. That part I understood but the area which I'm having issues with is choosing how the variables are defined (I hope I'm using the right terminology). In other words I have no clue how to fill this section out as seen in the image --> Thus far I've set the following as.... Begin processing on record: 1 Variable array to receive results: T1,T2,T3,T4 etc However, what do I set for the properties for the above variables and do I need more variables? Quote Link to comment Share on other sites More sharing options...
vpoon Posted July 30, 2010 Author Report Share Posted July 30, 2010 Thanks for the responses as it has been extremely helpful in clarifying the process. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.