10-03-2008 06:36 AM
Hello,
I need to print out a list of acquisition data in a report.
I have a for loop in which every iteration I want to read one data, update the report and then print the report.
Question: How I can select these data which format is a string like
MP1
MP2
MP3
Is it possible to define a varaible that is a sum of a string radix (MP) and a number (1) which encrease each iteration of the loop?
Thanks
Marco
10-03-2008 08:28 AM
Hello Marco!
You can build a string out of another string and an integer in VBS just with a + operator or better the & operator: Have a look at this example:
Option Explicit Dim i Dim Filename For i=1 To 3 Filename = "MP" & i & ".tdm" Call DataFileLoad(Filename,"TDM","Load") Next
Hope this helps
Matthias
Matthias Alleweldt Project Engineer / Projektingenieur | Twigeater? |
10-06-2008 03:37 AM
Thank you Matthias,
I still have problem in defining the folder from which the data are loaded.
Should I define another variable before the for loop?
How can I set the path in the following command?
Call DataFileLoad(Filename,"TDM","Load")
Best regards
Marco Milan
10-06-2008 03:50 AM
Hello Marco!
Two possible solutions. You can change the DIAdem variable DataDrvUser and set it to your path or you can use a variable in the code and use a full qualified filename (what I would prefer). This is the code:
Option Explicit Dim i Dim Filename Dim Path Path = "C:\MyData\" For i=1 To 3 Filename = Path & "MP" & i & ".tdm" Call DataFileLoad(Filename,"TDM","Load") Next
Matthias
Matthias Alleweldt Project Engineer / Projektingenieur | Twigeater? |