Jump to content











Photo
- - - - -

Macro/variable bug


  • Please log in to reply
23 replies to this topic

#1 Galapo

Galapo

    Platinum Member

  • .script developer
  • 3841 posts
  •  
    Australia

Posted 01 March 2010 - 09:55 AM

Today I've been trying to update a few things so that LiveXP will support WB080.

The following issue relates to CAPI commands 'RunFromRAM' and 'RunFromCD'.

The following code is working with 077rc2, but does not work with 080:

[Interface]

RunFromLoc="Run from RAM",1,4,7,46,94,21,"Run default","Run from RAM","Run from CD"

RunFromLocTextLabel="Run program from:",1,1,8,26,94,18,8,Normal



[Process]

StrFormat,REPLACE,%RunFromLoc%," ","",%runfrom%

If,Not,%runfrom%,Equal,Rundefault,%runfrom%,True

The following does not resolve the issue:

[Interface]

RunFromLoc="Run from RAM",1,4,7,46,94,21,"Run default","Run from RAM","Run from CD"

RunFromLocTextLabel="Run program from:",1,1,8,26,94,18,8,Normal



[Process]

StrFormat,REPLACE,%RunFromLoc%," ","",runfrom

If,Not,runfrom,Equal,Rundefault,runfrom,True

This does not resolve the issue either, returns a list index out of bounds:

[Interface]

RunFromLoc="Run from RAM",1,4,7,46,94,21,"Run default","Run from RAM","Run from CD"

RunFromLocTextLabel="Run program from:",1,1,8,26,94,18,8,Normal



[Process]

StrFormat,REPLACE,%RunFromLoc%," ","",%runfrom%

If,Not,%runfrom%,Equal,Rundefault,Begin

Set,runfrom,%runfrom%

runfrom,True

End

Thanks,
Galapo.

#2 Galapo

Galapo

    Platinum Member

  • .script developer
  • 3841 posts
  •  
    Australia

Posted 01 March 2010 - 07:42 PM

The following also does not work:
[Interface]

RunFromLoc="Run from RAM",1,4,7,46,94,21,"Run default","Run from RAM","Run from CD"

RunFromLocTextLabel="Run program from:",1,1,8,26,94,18,8,Normal



[Process]

StrFormat,REPLACE,%RunFromLoc%," ","",runfrom

Set,%runfrom%,runfrom

If,Not,%runfrom%,Equal,Rundefault,runfrom,True

Would seem there's problems with going from variables to macros and vice versa.

Thanks,
Galapo.

#3 Galapo

Galapo

    Platinum Member

  • .script developer
  • 3841 posts
  •  
    Australia

Posted 01 March 2010 - 07:45 PM

This also does not work:
[Interface]

RunFromLoc="Run from RAM",1,4,7,46,94,21,"Run default","Run from RAM","Run from CD"

RunFromLocTextLabel="Run program from:",1,1,8,26,94,18,8,Normal



[Process]

StrFormat,REPLACE,%RunFromLoc%," ","",%runfrom%

StrFormat,REPLACE,%RunFromLoc%," ","",runfrom

If,Not,%runfrom%,Equal,Rundefault,runfrom,True

Would seem the issue also relates to string handling. Seems StrFormat cannot be used to create a macro as in previous versions.

Thanks,
Galapo.

#4 Lancelot

Lancelot

    Frequent Member

  • .script developer
  • 5013 posts
  • Location:Turkiye/Izmir
  • Interests:*Mechanical stuff and Physics,
    *LiveXP, BartPE, SherpyaXPE,
    *Basketball and Looong Walking,
    *Buying outwear for my girlf (Reason: Girls are stupid about buying bad stuff to make themselves uglier :))
    *Girls (Lyric: Girl,...., You will be a womann, Soon)
    *Answering questions for "Meaning of life",
    *Helping people,

    Kung with LiveXP, Fu with Peter :)
  •  
    Turkey

Posted 01 March 2010 - 08:14 PM

Thanks boss,

keeping an eye here :dubbio:

#5 Galapo

Galapo

    Platinum Member

  • .script developer
  • 3841 posts
  •  
    Australia

Posted 01 March 2010 - 08:22 PM

This also does not work, I get a list index out of bounds:

[Process]

Set,runfrom,RunFromRAM

runfrom,True

This does not work either:

[Variables]

runfrom=RunFromRAM



[Process]

runfrom,True

And this does not work:
[Variables]

%runfrom%=RunFromRAM



[Process]

%runfrom%,True

So how do this under WB080?

Thanks,
Galapo.

#6 Galapo

Galapo

    Platinum Member

  • .script developer
  • 3841 posts
  •  
    Australia

Posted 01 March 2010 - 09:57 PM

This isn't working either:

[Interface]

RunFromLoc="Run from RAM",1,4,7,46,94,21,"Run default","Run from RAM","Run from CD"

RunFromLocTextLabel="Run program from:",1,1,8,26,94,18,8,Normal



[Process]

StrFormat,REPLACE,%RunFromLoc%,"Run from ","",%runfrom%

If,Not,%RunFromLoc%,Equal,"Run default",RunFrom%runfrom%,True

Thanks,
Galapo.

#7 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 02 March 2010 - 08:29 AM

You try to use a variable as macro! :exclamation:

That cannot work!

This works:
[Interface]

pButton1=Test,1,8,152,305,80,25,Test,0,False,False,_Test_,False



[test]

StrFormat,REPLACE,%RunFromLoc%," ","",%Temp%

Set,runfrom,"Run,%ScriptFile%,%Temp%,True"

If,Not,%Test%,Equal,Rundefault,runfrom



[RunfromRAM]

Echo,"Run from RAM"



[RunfromCD]

Echo,"Run from CD"

Peter :exclamation:

Edit: changed typo %Temt% > %Temp%

#8 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 02 March 2010 - 08:39 AM

You try to use a variable as macro! :cheers:


Well, you may want to tone it down a bit. :exclamation:

IF both you and Galapo are accurate, it means that the old version mixed up macro and variables, and that was because you wrote the code that way. :exclamation:

:exclamation:

Wonko

#9 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 02 March 2010 - 08:46 AM

IF both you and Galapo are accurate, it means that the old version mixed up macro and variables, and that was because you wrote the code that way. :exclamation:

Correct!

Peter :exclamation:

#10 Galapo

Galapo

    Platinum Member

  • .script developer
  • 3841 posts
  •  
    Australia

Posted 02 March 2010 - 09:08 AM

You try to use a variable as macro! :exclamation:

That cannot work!

This works:

[Interface]

pButton1=Test,1,8,152,305,80,25,Test,0,False,False,_Test_,False



[test]

StrFormat,REPLACE,%RunFromLoc%," ","",%Temp%

Set,runfrom,"Run,%ScriptFile%,%Temt%,True"

If,Not,%Test%,Equal,Rundefault,runfrom



[RunfromRAM]

Echo,"Run from RAM"



[RunfromCD]

Echo,"Run from CD"

Peter :exclamation:


Hi Peter,

Thanks for that.

I'm afraid I'm not able to "translate" your example back into what I want the function to do.

This is working prior to WB080:
[Interface]

RunFromLoc="Run from RAM",1,4,7,46,94,21,"Run default","Run from RAM","Run from CD"

RunFromLocTextLabel="Run program from:",1,1,8,26,94,18,8,Normal



[Process]

StrFormat,REPLACE,%RunFromLoc%," ","",%runfrom%

If,Not,%runfrom%,Equal,Rundefault,%runfrom%,True

What is the coding for use with 080?

I thought this might work, but I get a list index out of bounds:
[Interface]

RunFromLoc="Run from RAM",1,4,7,46,94,21,"Run default","Run from RAM","Run from CD"

RunFromLocTextLabel="Run program from:",1,1,8,26,94,18,8,Normal



[Process]

StrFormat,REPLACE,%RunFromLoc%," ","",%runfrom%

If,Not,%runfrom%,Equal,Rundefault,Begin

Set,runfrom,%runfrom%

runfrom,True

End

Thanks,
Galapo.

#11 Galapo

Galapo

    Platinum Member

  • .script developer
  • 3841 posts
  •  
    Australia

Posted 02 March 2010 - 09:16 AM

IF both you and Galapo are accurate, it means that the old version mixed up macro and variables, and that was because you wrote the code that way. :exclamation:

That's right. Trouble is, I'm still confused about 080 macros. 080 was a bit rushed out the door, so I didn't get to test completely and now I've discovered the cas eof this thread.

For example, 'RunFromRAM' is a function from CAPI, ie it executes. I would have thought placing this in a macro (not a variable as under pre-080 WB) that this should also execute, but it does not.

Eg, working pre-080:
[Process]

Set,%runfrom%,RunFromRAM

%runfrom%,True

Updating to variable to macro under 080, but does not work:
[Process]

Set,%runfrom%,RunFromRAM

Set,runfrom,%runfrom%

runfrom,True
[Process]

Set,runfrom,RunFromRAM

runfrom,True

Regards,
Galapo.

#12 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 02 March 2010 - 09:19 AM

Hi Peter,

Thanks for that.

I'm afraid I'm not able to "translate" your example back into what I want the function to do.

This is working prior to WB080:

[Interface]

RunFromLoc="Run from RAM",1,4,7,46,94,21,"Run default","Run from RAM","Run from CD"

RunFromLocTextLabel="Run program from:",1,1,8,26,94,18,8,Normal



[Process]

StrFormat,REPLACE,%RunFromLoc%," ","",%runfrom%

If,Not,%runfrom%,Equal,Rundefault,%runfrom%,True

What is the coding for use with 080?

I thought this might work, but I get a list index out of bounds:
[Interface]

RunFromLoc="Run from RAM",1,4,7,46,94,21,"Run default","Run from RAM","Run from CD"

RunFromLocTextLabel="Run program from:",1,1,8,26,94,18,8,Normal



[Process]

StrFormat,REPLACE,%RunFromLoc%," ","",%runfrom%

If,Not,%runfrom%,Equal,Rundefault,Begin

Set,runfrom,%runfrom%

runfrom,True

End

Thanks,
Galapo.

What should "runfrom,True" do?
(Translated e.g. "RunFromCD,True")

IMO there is at least a Run,%ScriptFile% missing.

Peter

BTW can I have that script (or do I have in LiveXP)?

#13 Galapo

Galapo

    Platinum Member

  • .script developer
  • 3841 posts
  •  
    Australia

Posted 02 March 2010 - 09:36 AM

It's for use with the CAPI commands 'RunFromRAM' and 'RunFromCD'.

To simplify, this is working pre-080 but not working with 080:

[Variables]

RunFromRam=Run,%API%,Run_FromRam1



[Process]

Set,%runfrom%,RunFromRAM

%runfrom%,True

I had thought this should work with 080, but I get a list index out of bounds:
[Variables]

RunFromRam=Run,%API%,Run_FromRam1



[Process]

Set,runfrom,RunFromRAM

runfrom,True

Thanks,
Galapo.

#14 Galapo

Galapo

    Platinum Member

  • .script developer
  • 3841 posts
  •  
    Australia

Posted 02 March 2010 - 08:47 PM

:exclamation:

#15 PaPeuser

PaPeuser

    Silver Member

  • Advanced user
  • 787 posts
  •  
    United States

Posted 02 March 2010 - 09:40 PM

FYI - I don’t select CAPI with Win7

#16 Lancelot

Lancelot

    Frequent Member

  • .script developer
  • 5013 posts
  • Location:Turkiye/Izmir
  • Interests:*Mechanical stuff and Physics,
    *LiveXP, BartPE, SherpyaXPE,
    *Basketball and Looong Walking,
    *Buying outwear for my girlf (Reason: Girls are stupid about buying bad stuff to make themselves uglier :))
    *Girls (Lyric: Girl,...., You will be a womann, Soon)
    *Answering questions for "Meaning of life",
    *Helping people,

    Kung with LiveXP, Fu with Peter :)
  •  
    Turkey

Posted 02 March 2010 - 09:41 PM

FYI - I don’t select CAPI with Win7

what is the question !? or what you mean !?

#17 PaPeuser

PaPeuser

    Silver Member

  • Advanced user
  • 787 posts
  •  
    United States

Posted 02 March 2010 - 09:45 PM

It is not a question,

its a statment, a fact , i find CAPI junk when it comes to Win7PE

I reported before about Run from Ram,

#18 Lancelot

Lancelot

    Frequent Member

  • .script developer
  • 5013 posts
  • Location:Turkiye/Izmir
  • Interests:*Mechanical stuff and Physics,
    *LiveXP, BartPE, SherpyaXPE,
    *Basketball and Looong Walking,
    *Buying outwear for my girlf (Reason: Girls are stupid about buying bad stuff to make themselves uglier :))
    *Girls (Lyric: Girl,...., You will be a womann, Soon)
    *Answering questions for "Meaning of life",
    *Helping people,

    Kung with LiveXP, Fu with Peter :)
  •  
    Turkey

Posted 02 March 2010 - 09:50 PM

I can not remember very clearly PaPeuser,
I guess your previous report has no relation to current topic, if you can point a link i can look more closely and give more details.

#19 PaPeuser

PaPeuser

    Silver Member

  • Advanced user
  • 787 posts
  •  
    United States

Posted 02 March 2010 - 09:58 PM

I can not remember very clearly PaPeuser,
I guess your previous report has no relation to current topic, if you can point a link i can look more closely and give more details.



http://www.boot-land...showtopic=10363

#20 Galapo

Galapo

    Platinum Member

  • .script developer
  • 3841 posts
  •  
    Australia

Posted 02 March 2010 - 10:07 PM

It is not a question,

its a statment, a fact , i find CAPI junk when it comes to Win7PE

I reported before about Run from Ram,


This topic has nothing to do with CAPI as such, nor with CAPI under Win7PE.

Topic has to do with variable and macro handling under WinBuilder. You'll need to post to the api topic your request for enhancements.

Regards,
Galapo.

#21 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 03 March 2010 - 09:33 AM

This topic has nothing to do with CAPI as such, nor with CAPI under Win7PE.
Topic has to do with variable and macro handling under WinBuilder. You'll need to post to the api topic your request for enhancements.

Topic has nothing to do with variables handling.
It has to do with nested macros.
That has simply been not provided.

Fixed now.

Peter

#22 Galapo

Galapo

    Platinum Member

  • .script developer
  • 3841 posts
  •  
    Australia

Posted 03 March 2010 - 10:10 AM

Hi Peter,

Thanks indeed for that, that's great news.

Is fixed version available at winbuilder.net?

Thanks,
Galapo.

#23 dera

dera

    Gold Member

  • .script developer
  • 1335 posts
  •  
    Hungary

Posted 03 March 2010 - 10:18 AM

as i can see rev3 is available at winbuilder.net

#24 Galapo

Galapo

    Platinum Member

  • .script developer
  • 3841 posts
  •  
    Australia

Posted 03 March 2010 - 10:44 AM

Yep, revision 3 is there. Thanks indeed Peter for this, even though you've done what Nuno said would not be happening! http://www.boot-land...showtopic=10565

You have our support. This will help Lancelot and I get LiveXP ready for WB080.

Thanks,
Galapo.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users