cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Register for our Discovery Summit 2024 conference, Oct. 21-24, where you’ll learn, connect, and be inspired.
Choose Language Hide Translation Bar
SpannerHead
Level IV

Include() with Wildcards

I have a main script that calls exterior JSL scripts depending on the content of a particular column.  The exterior JSL scripts themselves and their names are revised periodically to reflect spec changes.  Can wildcards be used with Include() to bypass any naming change to the script that gets called?


Slán



SpannerHead
2 ACCEPTED SOLUTIONS

Accepted Solutions
jthi
Super User

Re: Include() with Wildcards

I don't think so but if the file is always in same folder, you can figure out which file you should include by first checking all file names.

-Jarmo

View solution in original post

SpannerHead
Level IV

Re: Include() with Wildcards

A friend at work made a similar suggestion.

 

This appears to work.

 

Script_Options = Files in Directory("\\Directory Name\");


//Keyphrase is the unique string to identify the script that should execute

For( i = 1, i <= N Items( Script_Options ), i++,
	If( Contains( Script_Options[i], "Keyphrase" ), scripttorun = Script_Options[i]););

	Chosen = "\\Directory Name\"||scripttorun;
		
	Include(Chosen);

Slán



SpannerHead

View solution in original post

2 REPLIES 2
jthi
Super User

Re: Include() with Wildcards

I don't think so but if the file is always in same folder, you can figure out which file you should include by first checking all file names.

-Jarmo
SpannerHead
Level IV

Re: Include() with Wildcards

A friend at work made a similar suggestion.

 

This appears to work.

 

Script_Options = Files in Directory("\\Directory Name\");


//Keyphrase is the unique string to identify the script that should execute

For( i = 1, i <= N Items( Script_Options ), i++,
	If( Contains( Script_Options[i], "Keyphrase" ), scripttorun = Script_Options[i]););

	Chosen = "\\Directory Name\"||scripttorun;
		
	Include(Chosen);

Slán



SpannerHead