Topic: GetParam, PackParam  (Read 214 times)

0 Members and 1 Guest are viewing this topic.

GetParam, PackParam
« on: December 12, 2017, 07:15:57 PM »

Galapo

  • Gena Baker
  • Grand Chef
  • *****
  • Location: Australia
  • Date Registered: Sep 2010
  • Posts: 2014
2. GetParam, PackParam
In WB082, these 2 commands do not work properly (thus no occurence in Win10PESE).
PEBakery can recognize section parameter bigger than 9 (Ex #10, #12), so I expect PackParam and GetParam will not be necessary in future.
Galapo, do you think this commands are still worth to implement? I will do so if you want.

Rather than posting in the original thread, I think it's best to post separately to keep things a bit more organised.

Oh my - more commands in WB082 that had bugs introduced. :frusty: This unpredicability was the reason why we ended up deciding to stick with WB077RC2 for Gena.

I think the main reason why the PackParam command was introduced because there was no way of knowing how many parameters had been supplied. This command allowed for (a) a check within the supplied parameters for a certain string (used in Gena for registry injection at boot); and (b) a way to determine the total number of parameters (but this wasn't used and in reality may not be practically useful).

In any case, what PackParam did is needed in Gena, either by support within PEBakery itself, or by adding a macro command in the project with AutoIt.

Regards,
Galapo.

Re: GetParam, PackParam
« Reply #1 on: December 12, 2017, 08:29:53 PM »

Homes32

  • Code Baker
  • Chef
  • ***
  • Date Registered: Dec 2010
  • Posts: 147
I think the main reason why the PackParam command was introduced because there was no way of knowing how many parameters had been supplied. This command allowed for (a) a check within the supplied parameters for a certain string (used in Gena for registry injection at boot); and (b) a way to determine the total number of parameters (but this wasn't used and in reality may not be practically useful).

It had more to do with the Run command not accepting more then 9 parameters. I remember it because pedro was having issues with that when he wrote the CAPI. the whole Get/Pack was buggy as hell in ver 80 :( I woulden't cry if it went away.  :wink:
« Last Edit: December 12, 2017, 08:30:53 PM by Homes32 »

Re: GetParam, PackParam
« Reply #2 on: December 14, 2017, 11:31:20 PM »

ied206

  • Moderator,
  • Chef
  • *****
  • Location: South Korea
  • Date Registered: Jan 2014
  • Posts: 203
I think the main reason why the PackParam command was introduced because there was no way of knowing how many parameters had been supplied. This command allowed for (a) a check within the supplied parameters for a certain string (used in Gena for registry injection at boot); and (b) a way to determine the total number of parameters (but this wasn't used and in reality may not be practically useful).

In that case, I will implement GetParam and PackParam.
Since PEBakery does not have limit in parameter's number, I hope GetParam and PackParam can be removed later.
To resolve reason (b), how about adding #a for count of arguments?

It had more to do with the Run command not accepting more then 9 parameters. I remember it because pedro was having issues with that when he wrote the CAPI. the whole Get/Pack was buggy as hell in ver 80 :( I woulden't cry if it went away.  :wink:
Yes, that's why PEBakery supports 10 parameters or bigger.

Re: GetParam, PackParam
« Reply #3 on: December 15, 2017, 11:25:29 AM »

ied206

  • Moderator,
  • Chef
  • *****
  • Location: South Korea
  • Date Registered: Jan 2014
  • Posts: 203
GetParam/PackParam implemented in commit cffb428.
https://github.com/ied206/PEBakery/commit/cffb4287c26c0ae57052fa991ce7f45dfdada152

(b) a way to determine the total number of parameters (but this wasn't used and in reality may not be practically useful).
To support usecase (b), I added token #a.
It returns current section parameter's number, same result with PackParam's optional 3rd argument.

Note that using #[0-9] token as a memory slot can cause #a to malfunction.
Code: [Select]
[Process]
Run,%ScriptFile%,SecTest,1,2,3,4,5

[SecTest]
Echo,#a
Set,#9,World
Echo,#a
This code will display 5 first and 9 later.
This behavior is same with PackParam in WB077rc2, so preventing this issue can be quite difficult.


 

Powered by EzPortal