SYntax Issue ScenEdit_SetZone?

All discussions & material related to Command's Lua interface

Moderators: RoryAndersonCDT, michaelm75au, angster, MOD_Command

Post Reply
User avatar
vettim89
Posts: 3745
Joined: Fri Jul 13, 2007 11:38 pm
Location: Toledo, Ohio

SYntax Issue ScenEdit_SetZone?

Post by vettim89 »

I have the following in a scenario:

ScenEdit_SetZone(sideName='United States', zoneType='0', {description='France", isactive='false'})

It is coming back as an error saying expecting ")" near "=" with the end of the line near false highlighted in pink. What am I missing here?
"We have met the enemy and they are ours" - Commodore O.H. Perry
KnightHawk75
Posts: 1850
Joined: Thu Nov 15, 2018 7:24 pm

RE: SYntax Issue ScenEdit_SetZone?

Post by KnightHawk75 »

ORIGINAL: vettim89

I have the following in a scenario:

ScenEdit_SetZone(sideName='United States', zoneType='0', {description='France", isactive='false'})

It is coming back as an error saying expecting ")" near "=" with the end of the line near false highlighted in pink. What am I missing here?

You opened a string with ' and ended it with " near France, use one or the other but don't mix them per string.
Also isactive there should be a boolean value not the string representation of false so no quotes needed, though it may work as is as some function will attempt to convert the string to boolean, some will not though.
try:
ScenEdit_SetZone(sideName='United States', zoneType='0', {description='France', isactive=false})


User avatar
vettim89
Posts: 3745
Joined: Fri Jul 13, 2007 11:38 pm
Location: Toledo, Ohio

RE: SYntax Issue ScenEdit_SetZone?

Post by vettim89 »

ORIGINAL: KnightHawk75
ORIGINAL: vettim89

I have the following in a scenario:

ScenEdit_SetZone(sideName='United States', zoneType='0', {description='France", isactive='false'})

It is coming back as an error saying expecting ")" near "=" with the end of the line near false highlighted in pink. What am I missing here?

You opened a string with ' and ended it with " near France, use one or the other but don't mix them per string.
Also isactive there should be a boolean value not the string representation of false so no quotes needed, though it may work as is as some function will attempt to convert the string to boolean, some will not though.
try:
ScenEdit_SetZone(sideName='United States', zoneType='0', {description='France', isactive=false})



made the changes and still getting the same error:

>> ScenEdit_SetZone(sideName='United States', zoneType='0', {description='France', isactive=false})
ScenEdit_MsgBox('Admiral, \n\n Violation of Frnch air space has been authorized', 1)
ERROR: [string "Console"]:1: ')' expected near '='
"We have met the enemy and they are ours" - Commodore O.H. Perry
KnightHawk75
Posts: 1850
Joined: Thu Nov 15, 2018 7:24 pm

RE: SYntax Issue ScenEdit_SetZone?

Post by KnightHawk75 »

...

Sorry I didn't even notice before you're saying sidename= and zonetype= when you shouldn't for that particular function.
ScenEdit_SetZone('United States',0, {description='France', isactive=false})

User avatar
vettim89
Posts: 3745
Joined: Fri Jul 13, 2007 11:38 pm
Location: Toledo, Ohio

RE: SYntax Issue ScenEdit_SetZone?

Post by vettim89 »

ORIGINAL: KnightHawk75

...

Sorry I didn't even notice before you're saying sidename= and zonetype= when you shouldn't for that particular function.
ScenEdit_SetZone('United States',0, {description='France', isactive=false})


Thank you! That did the trick.
"We have met the enemy and they are ours" - Commodore O.H. Perry
Post Reply

Return to “Lua Legion”