Hello,
In my scripts I very frequently search for the existence of certain long names. I do this using a trick that I was shown in the forum:
https://my.originlab.com/forum/topic.asp?TOPIC_ID=44260
Now I find myself in a situation where I need to check if a workbook exists, whose long name partially matches a string. In a web search engine we would use the wildcard character * to mean "anything". For example, if I check that Book1* exists, then that should return a positive for Book1, Book12, Book111111 etc ("Book1" plus "anything").
How do I do this in Labtalk?
My code looks like this:
string nextmeassheetname$="%(batch$)_%(meastype$)_$(%(measNo$)+1)*";
if(exist(%(uid2name(range2uid(["%(nextmeassheetname$)"]))$))!=0)
continue; // if this is not the last measurement of its kind, then continue to the next iteration
Notice the wildcard written in $(%(measNo$)+1)*. The wildcard character * does not work in this case....
By reading the tutorials, I understood that the exist function does not support wildcard characters.
Origin Ver. and Service Release (Select Help-->About Origin): Origin 2019
Operating System: Windows 8.1