Developer forum
cancel
Showing results for 
Search instead for 
Did you mean: 

LPXML - Making standalone GSM with macros

Anonymous
Not applicable
Hi, I have a problem when making a standalone GSM.

I Have a GSM with several macro calls (i.e. i call another GSM objects). I want to make a standalone GSM.

I don't know if I can replace the call and macro sections and how. I'm working with XMLs converted with LPXML. I guessed LPXML has this feature (for embedding macros), but I'm not sure.

Currently working on AC16 with LPXML for AC16.

Any suggestions? Thx in advance.
5 REPLIES 5

Anonymous
Not applicable
I'm not that up on the XML options. The old fashioned way is to copy/paste the scripts from the macros into the main part. This can be done inline or using GOSUB.

If you go this route be sure to comment the code well. It is likely to get long and unwieldy. I find the following to be helpful...
!MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM   Description of Code Section
...for section headers.
!_________________________________________    Description of Code Segment to Follow
...to ID the functional parts.

With long enough leaders I can scan the comments easily as I scroll the code.

Anonymous
Not applicable
Can you please provide a little example using the GOSUB way? I don't know what sections from XML I need to copy from. I don't care about the comments sections. Thank you

Anonymous
Not applicable
I don't have an example handy as I am on my iPad.

The process within GDL is pretty simple (generally) but as I said I don't know much about the XML.

In the script you just replace the CALL statement with the GOSUB and copy/paste the necessary code into the script.

The basic form is something like...
! Bunch of code doing stuff...

GOSUB 1000

! More code doing more stuff...

END

1000: ! Code copied from previously used macro...

RETURN ! Continues execution back at the GOSUB statement
There are other ways to structure it but this is typical. The END statement terminates the script and prevents the subroutines from running again.

Note that the line numbering is the old form. I believe it can also be done with arbitrary strings now but I haven't used this method myself yet. The line numbers are also arbitrary, don't have to be in any order and have nothing to do with the actual number of lines in the code.

Anonymous
Not applicable
Thank you!

You are right with the labels, it can be strings (even quoted) 😉

I'm not GDL programmer, so I don't know so much about it. I saw a couple of GSM having call inside it, calling another GSM.. and that GSM could be large, having specified 2D script, 3D script, etc. etc. I just still don't know if I should paste all scripts to the call section and how to handle "call someMacro with parameters abcd" with the gosub way

I need to automate this via scripts.

Anonymous
Not applicable
You should check the return value of ACAPI_3D_GetCurrentWindowSight before using the sight. In case of non-3d sight it will return APIERR_BADWINDOW I think. The void** parameter won't change.

Still looking?

Browse more topics

Back to forum

See latest solutions

Accepted solutions

Start a new discussion!