Jump to content
Sign in to follow this  
The Artful Dodger

A Quick Question

Recommended Posts

Is it possible to replace the "VOICE:Microsoft Catherine" in the macro: <Macro Name="C208B">VOICE:Microsoft Catherine) (VOICERATE:0) (VOICEVOLUME:15) (SPEAK</Macro>

with a string variable? To produce something like this:

<Macro Name="C208B">VOICE:(L:Voice, String)) (VOICERATE:0) (VOICEVOLUME:15) (SPEAK</Macro>

So that

"Microsoft Catherine" (>L:Voice, String)

would set it up.

 

Share this post


Link to post
Share on other sites

AAO (MSFS) manual, page 67, chapter about "RPN Macros":

Quote

You can also use LVars as macros, AAO will replace the „@variablename“ with the actual value:

2·(>L:engnum)

(A:ENG·COMBUSTION:@engnum,·Bool)

=> (A:ENG·COMBUSTION:2,·Bool)

In your case

<Macro·Name="C208B">VOICE:@voice)·(VOICERATE:0)·(VOICEVOLUME:15)·(SPEAK</Macro>
'Microsoft·Catherine'·(>L:voice,·String)
(@C208B:Test)

Edited by Lorby_SI

LORBY-SI

Share this post


Link to post
Share on other sites

Thank you so much - I guess I missed that paragraph.

Another quickie: when you issue a (CHECKLIST:xxx) command, does that work like a 'call' or a 'goto'? In other words, is there a return from a (CHECKLIST:xxx)  command? 

Share this post


Link to post
Share on other sites
1 hour ago, The Artful Dodger said:

Thank you so much - I guess I missed that paragraph.

Another quickie: when you issue a (CHECKLIST:xxx) command, does that work like a 'call' or a 'goto'? In other words, is there a return from a (CHECKLIST:xxx)  command? 

I'm sorry, but I don't understand the question. All AAO scripting is asynchronous, the command doesn't block processing. While the checklist is running, you can call a thousand other scripts, script files or CONVERSATIONs and they will execute in parallel. 

How would a checklist "return" to where exactly?

Edited by Lorby_SI

LORBY-SI

Share this post


Link to post
Share on other sites
Statement A
.
.
(CHECKLIST:My_Checklist.txt)
Statement B

I execute My_Checklist.txt but once My_Checklist is complete, does it now execute Statement B (effectively a call) or is Statement effectively dead (effectively a GOTO)?

Edited by The Artful Dodger

Share this post


Link to post
Share on other sites
19 minutes ago, The Artful Dodger said:

Statement A
.
.
(CHECKLIST:My_Checklist.txt)
Statement B

I execute My_Checklist.txt but once My_Checklist is complete, does it now execute Statement B (effectively a call) or is Statement effectively dead (effectively a GOTO)?

No, that is not how this works.

As I tried to explain above, everything is asynchronous. Statement B will be executed immediately, regardless of what the checklist is doing or not doing.

The only way for a sequence like you want would be a CONVERSATION where you call the checklist and the checklist then sets an LVar at the end and Statements B would use [] to wait for that change. 
But it would be much more simple to just call Statement B at the end of the checklist file...

Edited by Lorby_SI

LORBY-SI

Share this post


Link to post
Share on other sites

I was afraid that was the case. So, if I don't want Statement B to execute I would have to say:

(CHECKLIST:My_Checklist.txt) (GOTO Somewhere_else)

Statement B

Is that how to prevent B from executing?

Share this post


Link to post
Share on other sites
7 minutes ago, The Artful Dodger said:

I was afraid that was the case. So, if I don't want Statement B to execute I would have to say:


(CHECKLIST:My_Checklist.txt) (GOTO Somewhere_else)

Statement B

Is that how to prevent B from executing?

What is the point of this exercise? Why add Statement B at all when it is not supposed to be executed anyway?

The GOTO will also not wait for the CHECKLIST, it will be executed immediately (and jump over Statement B)

As mentioned before, what you want to do is a job for the CONVERSATION feature. With a little effort you should be able to impelemt the desired control flow.

Edited by Lorby_SI

LORBY-SI

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...