| T O P I C R E V I E W |
| Flavs |
Posted - 08/29/2006 : 2:12:27 PM Origin Version (Select Help-->About Origin):7.5 Operating System:win xp sp2
I want to re-use some labtalk scripts. To do this I need to pass arguments to my functions. For example, suppose I have a labtalk script that copies file a to file b (where a and b are int variables), I can give a and b the values and then run the script like this
a=2 b=3 run.section(copy)
Is there any way of doing this in a direct form, like the way you do in C? how do I pass arguments to a labtalk script(function)?
|
| 2 L A T E S T R E P L I E S (Newest First) |
| Flavs |
Posted - 09/07/2006 : 10:20:58 AM Thanks, that worked well!! |
| Hideo Fujii |
Posted - 08/29/2006 : 4:59:49 PM Hi Flavs,
You can use upto 5 arguments in the "run.section" object method. See the Programming help. The syntax is: run.section(fileName,sectionName[,arg1 arg2 arg3 arg4 arg5])
Note that there are no commas between arguments. When arguments are passed to a section in the script, they are refered as %1, %2, etc. They are text variables. For example, if you create a script file D:\temp\AAA.ogs that has lines: [mysect1] type -a >> %1 plus %2 is $(%1+%2); and you enter the following in the Script window: run.section(D:\temp\AAA.ogs,mysect1,2 3)<ENTER> you get: >> 2 plus 3 is 5
--Hideo Fujii OriginLab
|
|
|