Forum Discussion

Morgan's avatar
Morgan
Frequent Contributor
9 years ago
Solved

How do I convert a text variable to a wildcard?

I'm sure this is basic but I can't figure it out...

 

I am trying to feed in a file name as a variable to a subroutine and I only want to look for PART of the extended name so I have it surrounded by asterisks.  However, the asterisks are relayed as asterisks and the script doesn't hunt for the text within it.  Any ideas?  It looks similar to the following...

 

ProjectName := 'ABC'

 

RestoreProject('*'+ProjectName+'*',ProjectName); 

 

This is read as the text of *ABC*, which doesn't do me any good.

 

I've tried VarToStr but the result is still the same... I need the quotes or else TC errors.  What am I doing wrong here?

 

Thanks,

Morgan