External file loading question

For questions about using Classic.

Post » Tue Sep 27, 2011 4:09 am

The following "expression" is how you retrieve a file from a folder inside your game's folder:

AppPath & "GameFolder2\File.blah"

Well, what if the file you want to load is a variable? If you change the above to:

AppPath & "GameFolder2\global('file')"

then everything in the quotation marks is just turned into a string, even if the global value ends with the proper extension.

The only way I know how to get around this is to use sub events that compare the global value and then load the appropriate file, but if I have a lot of files to load then that could get tedious. Do I have a choice?
Tokinsom2011-09-27 04:10:28
Image
B
225
S
27
G
13
Posts: 1,774
Reputation: 18,024

Post » Tue Sep 27, 2011 4:26 am

Would this work?
Pull global('file') out of the quotes and just combine it with &.

AppPath & "GameFolder2\" & global('file')
B
79
S
24
G
52
Posts: 4,725
Reputation: 39,713

Post » Tue Sep 27, 2011 5:02 am

Don't know why I didn't try that earlier -w-; But yeah it works. Thanks!
Image
B
225
S
27
G
13
Posts: 1,774
Reputation: 18,024


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 2 guests