Home   Help Search Login Register  

Author Topic: File name variable  (Read 420 times)

0 Members and 1 Guest are viewing this topic.

ScrubMuncher

  • Guest
File name variable
« on: 24 Apr 2004, 23:09:02 »
Hi all,

I've searched, and diddled around the posts, and can't find any reference or method of building a string variable to represent a filename to execute.

Looking for something like:

_filenum = _filenum+1
[] exec "testfile%1", filenum  (just dreamed this example up.. might work,  ::)


Hope my syntax makes sense.  I'd like to execute testfile1, testfile2, testfile3... Probably not in order, which is why I need a simple variable to count, and build the filename to execute the available sequential files (counting the files is handled already, I just need to emulate some STR functions that I don't think OFP has)

Any reference or tidbit would be greatly appreaciated.. This is going to be for police type missions or ambient activity in standard missions.

Thanks again,

Scrub

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:File name variable
« Reply #1 on: 25 Apr 2004, 01:04:50 »
Try:

_filenum = _filenum + 1
_script = format ["testfile%1.sqs",_filenum]

[] exec _script

:note - i added .sqs at the end to make it look like:

 testfileXX.sqs

~S~ CD
Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted

ScrubMuncher

  • Guest
Re:File name variable
« Reply #2 on: 25 Apr 2004, 02:16:37 »
Mr. Death, most helpful! Thank you.  I was just was experimenting with that very thing, and you saved me a bunch of syntax hassle. Much appreciated. :thumbsup:

Wow, the level of service you guys create is better than most first tier companies.. And no, I'm not kidding.  Thanks OFPEC.

Scrub