Here you are only temporarily swapping the value of MCfiletype for MCstackfiletype - since in the intervening period whilst the values are swapped, these two globals cannot be changed you just need to do:
```
MCStringRef oldfiletype;
oldfiletype = MCfiletype;
MCfiletype = MCstackfiletype;
```
Then, later on when reversing the switch, just do:
```
MCfiletype = oldfiletype;
```