zovirl 0 Posted November 20, 2001 Ok, how do you put quotes inside a string? Â As an example, I want a hint that says something like this: Run to the "camp" quickly! (What I actually want is to have a hint statement inside a foreach statement, which would require nested quotes.) (Edited by zovirl at 10:30 pm on Nov. 20, 2001) Share this post Link to post Share on other sites
HappyG 0 Posted November 20, 2001 I have one question too... What if I want to exec [_x] exec "blabla.sqs" for every unit in array with foreach command? "[_x] exec "blabla.sqs"" foreach ArrayOfunits <-? :-) Share this post Link to post Share on other sites
Space Cadet 1 Posted November 21, 2001 You could try the single quote ' instead - Works for SQL statments. Share this post Link to post Share on other sites
HappyG 0 Posted November 21, 2001 I already tried it... But unfortunetly it doesn't work ;-) Share this post Link to post Share on other sites
Gaswell 1 Posted November 21, 2001 About [_x] exec "blabla.sqs": You could try this: s="blabla.sqs"; "[_x] exec s" foreach ArrayOfunits Don't know how to get quotes inside strings, though. Share this post Link to post Share on other sites
zovirl 0 Posted November 21, 2001 </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote </td></tr><tr><td id="QUOTE">Quote: from Gaswell on 3:40 pm on Nov. 21, 2001 About [_x] exec "blabla.sqs": You could try this: s="blabla.sqs"; "[_x] exec s" foreach ArrayOfunits Don't know how to get quotes inside strings, though.<span id='postcolor'> I tried this: _Array = + list tEast _Script = "print.sqs" [player] exec _Script "[_x] exec _Script" foreach _Array "_x setdammage 1" foreach _Array exit The line where it prints out the player works. The foreach with the print doesn't work. The setdammage works. So what I am thinking is that inside it is still choking on the nested quotes. Anyone from BIS care to comment on this? Is there any way to do this? Share this post Link to post Share on other sites
HappyG 0 Posted November 22, 2001 I saw that in sqm file: init="this addweaponcargo [""M21"",5]; this addmagazinecargo [""M21"",25]"; So maybe we can use the same syntax in our scripts? Share this post Link to post Share on other sites
HappyG 0 Posted November 22, 2001 I saw that in sqm file: init="this addweaponcargo [""M21"",5]; this addmagazinecargo [""M21"",25]"; So maybe we can use the same syntax in our scripts? Share this post Link to post Share on other sites
Gaswell 1 Posted November 22, 2001 Interesting. Think I'll try those double quotes. Share this post Link to post Share on other sites
zovirl 0 Posted November 23, 2001 </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote </td></tr><tr><td id="QUOTE">Quote: from HappyG on 10:10 pm on Nov. 22, 2001 I saw that in sqm file: init="this addweaponcargo [""M21"",5]; this addmagazinecargo [""M21"",25]"; So maybe we can use the same syntax in our scripts? <span id='postcolor'> Doesn't seem to work elsewhere. That is odd...isn't it the same reader? At least for working through arrays of objects, you can write your own loop using the count statement. Still, it seems like there should be a way to nest quotes... Still wish BIS would just answer this and save us a bunch of time (of course, the problem is that the "answer this" part of that really means "answer this and a millon other questions" and they are already busy...) Share this post Link to post Share on other sites