The Oven

Plugin World => Macro Library => Macro/Command Support => Topic started by: ied206 on April 21, 2017, 09:19:54 AM

Title: Syntax error in Section [Download_Files]
Post by: ied206 on April 21, 2017, 09:19:54 AM
There is syntax error in Section [Download_Files].

Code: [Select]
// This section also used directly by ML
// 1 Folder 2 FileName 3 Web (Cancelled 4 NoExit )
If,#3-,Equal,-,Echo,"Download File - Parameter Missing%,Warn
Else,Run,%Api%,Download_Files_P,#1,#2,#3,#4,#5,#6,#7,#8,#9

One of the doublequote is missing in Echo,"Download File - Parameter Missing%,Warn.
I found this error while testing Macro Library with PEBakery, WinBuilder seems to ignore this.

Title: Re: Syntax error in Section [Download_Files]
Post by: Lancelot on April 21, 2017, 11:43:01 PM
Thanks ied206,

Macro Library updated to v43r76 with your fix.  :thumbsup:


ps:

keep in mind, there is rare double if inside plugins
If,....,If,.....
There is NO 3 or more if inside plugins
If,....,If,.....,If,.....
edit:
In history due to winbuilder bug reasons,  we intentionally avoid 3 or more If - Later in time we clean most of double if.

For your builder, We can convert all "double If" to "single If" ?  :great:
just let us know.    :thumbsup:

:turtle:
Title: Re: Syntax error in Section [Download_Files]
Post by: ied206 on April 22, 2017, 12:39:13 AM
I hadn't tried to write kind of 'converting' operations.

But since PEBakery generates kind of parse tree internally, I think cleaning nested If/Else would be able later.

Edit:
I guess I misunderstood your question.

PEBakery currently supports nested If/Else, so there is no need to convert into single If.

However, if we can, converting nested If into single If will helps us in point of readability.
(It will also help converting WB syntax into new syntax)
Title: Re: Syntax error in Section [Download_Files]
Post by: Lancelot on April 23, 2017, 12:56:08 AM
If,#3-,Equal,-,Echo,"Download File - Parameter Missing%,Warn
Else,Run,%Api%,Download_Files_P,#1,#2,#3,#4,#5,#6,#7,#8,#9
[/codebox]

One of the doublequote is missing in Echo,"Download File - Parameter Missing%,Warn.
I found this error while testing Macro Library with PEBakery, WinBuilder seems to ignore this.

I guess I misunderstood your question.

Thinking you work on IF syntax on PEBBakery,

I only remind IF syntax used double inside plugins since supported by wb.

And gave more info about that.

ex:
Win10PESE\Main Configuration
Code: [Select]
If,%WIMDriver%,Equal,Wimfltr,If,ExistFile,%Tools%\%OSArch%\wimgapi6.0.dll,Begin

:turtle: