Page 1 of 1

Problem with scripts

Posted: Mon Sep 30, 2013 9:47 am
by mikKummerfeld
Hey Guys,

how can I solve this problem:

I have a script with an insert script command. In this calling script there is a label at the start e.g ":label begin".
When I call this script in my main script more than one it does not work.

How would you solve that? I dont want to copy this script 30 times to be able to call it 30 times

Thanks...

Re: Problem with scripts

Posted: Mon Sep 30, 2013 10:48 am
by FrancescoT
Dear Heiko,

How do you call the script?
Are you using the "include Script" statement each time you need it in your main script?

Regards

Re: Problem with scripts

Posted: Mon Sep 30, 2013 10:50 am
by mikKummerfeld
Yes of course I do...is there a better way doing this ????

Re: Problem with scripts

Posted: Mon Sep 30, 2013 10:59 am
by FrancescoT
No, there isn't.

Regards

Re: Problem with scripts

Posted: Tue Oct 01, 2013 3:40 am
by mikKummerfeld
Bad... !

So do I really have to duplicate my script 30 times to call it 30 times ???

Like ImportScript, ImportScript02, ImportScript03....???

Re: Problem with scripts

Posted: Tue Oct 01, 2013 9:29 am
by FrancescoT
... you only have to duplicate the Import Script statement ... not the script file inclusion itself.

Honestly, I don't understand your comment ... it is the same if you need to call a fuction 30 times with any Code editor. isn't it?

Regards

Re: Problem with scripts

Posted: Tue Oct 01, 2013 4:25 pm
by mikKummerfeld
no it does not work...I cant include a script multiple times because I have a Label in the script with goto labels inside this script and there Comes a ERROR MESSAGE while building...
The Compiler "thinks", that I have "my Label" multiple times, because I insert the same script more than one..

SEEMS A BUG !

1. Create a script like this

:Label
...
goto Label

2. insert this script in main script 2 times
3. Build => BÄÄÄM

Re: Problem with scripts

Posted: Wed Oct 02, 2013 10:54 am
by FrancescoT
Dear Heiko,

it is not a bug ... it is simply because you can't use a label statement as you are doing.

You must keep in mind that a script ... it is not a function ... and due of this, you should use labels within your main script only or include your script one time only.

Otherwise a "multiple label declaration" error is returned

Hope this clarify your doubt.

Regards