Digg this topic Add to my del.icio.us Submit to SlashDot  
Reply to this topicStart new topic
> [WB Bug] Loading image into interface element does not work
booty#1
post Sep 22 2007, 01:44 PM
Post #1


Advanced Member
***

Group: .script developer
Posts: 182
Joined: 30-March 07
Member No.: 4,830


Germany


Hi,

I just stumbled over a bug in WB 072a: I wanted to add a screenshot to a script via an image-interface-element. If I load a picture into this image (e.g. "AgentRansack2.gif") it is encoded into the script but the image-element is not correctly set:

[Interface]
pImage1=none,1,5,10,40,100,100

booty#1
Go to the top of the page
 
+Quote Post
Nuno Brito
post Sep 22 2007, 03:13 PM
Post #2


Advanced Member
***

Group: .script developer
Posts: 4,153
Joined: 13-July 06
From: Azores
Member No.: 1


Portugal


Thanks! (IMG:../forums/style_emoticons/default/smile.gif)
Go to the top of the page
 
+Quote Post
booty#1
post Sep 23 2007, 09:21 AM
Post #3


Advanced Member
***

Group: .script developer
Posts: 182
Joined: 30-March 07
Member No.: 4,830


Germany


And another, IMHO more serious bug:

The message box shown by the following script has only three lines. The first two lines show correctly %Test1% and %Test2%, but the third line only contains "A" and the fourth line is totally missing...

CODE
[Main]
Title=Variables Section Test
Author=booty#1
Level=5
Version=001

[Variables]
%Test1%=Value1
%Test2%=Value 2
%Test3%="Value3"
%Test4%="Value 4"

[Process]
Message,"A %Test1% B#$xA %Test2% B#$xA %Test3% B#$xA %Test4% B",Information


Output in theory:
A Value1 B
A Value 2 B
A Value3 B
A Value 4 B

Output in praxis using WB072a:
A Value1 B
A Value 2 B
A

booty#1
Go to the top of the page
 
+Quote Post
Nuno Brito
post Sep 23 2007, 11:35 AM
Post #4


Advanced Member
***

Group: .script developer
Posts: 4,153
Joined: 13-July 06
From: Azores
Member No.: 1


Portugal


Strange enough but the scripting is sort of correct on it's perspective.

If you look closely on the value of %Test3% it's different from the previous variables because it is using ""

The message command will only output a line of message which is defined between "" - we can of course use special characters to make them appear inside the message but using more "" inside a single line will be interpreted as EOL ignoring the rest of the line.


This snippet works:

CODE

[Main]
Title=Variables Section Test
Author=booty#1
Level=5
Version=001

[Variables]
%Test1%=Value1
%Test2%=Value 2
%Test3%=Value3
%Test4%=#$qValue 4#$q

[Process]
Message,"A %Test1% B#$xA %Test2% B#$xA %Test3% B#$xA %Test4% B",Information


Just modified the last two variables to example both ways of displaying the value.


(IMG:../forums/style_emoticons/default/smile.gif)
Go to the top of the page
 
+Quote Post
booty#1
post Sep 23 2007, 12:16 PM
Post #5


Advanced Member
***

Group: .script developer
Posts: 182
Joined: 30-March 07
Member No.: 4,830


Germany


Ok, now I get it WinBuilder makes an early expansion of variables without encoding them. Therefore the line will get exanded before execution to:

Message,"A Value1 B#$xA Value 2 B#$xA "Value3" B#$xA "Value 4" B",Information

Is it really wise to allow injecting of parameters and commands via variables?


booty#1
Go to the top of the page
 
+Quote Post
Nuno Brito
post Sep 23 2007, 01:25 PM
Post #6


Advanced Member
***

Group: .script developer
Posts: 4,153
Joined: 13-July 06
From: Azores
Member No.: 1


Portugal


I'm not sure how wise this method can be when compared to your coding experience but the original intention was to make variables more flexible to even allow creating more commands as needed (currently applied in api scripts).

Otherwise how would these command parameters be splited correctly? (IMG:../forums/style_emoticons/default/huh.gif)


Go to the top of the page
 
+Quote Post
booty#1
post Sep 24 2007, 11:13 AM
Post #7


Advanced Member
***

Group: .script developer
Posts: 182
Joined: 30-March 07
Member No.: 4,830


Germany


Hi Nuno,

well my experience in scripting languages is not overarching - I can only describe how it is done in other languages.
Take for example Java-Script, they have a function called "eval()" which takes as parameter a String containing Java-Script code. This offers both, the flexibility to execute code via variables without the negative effect that variables are evaluated/expanded too early.

But as WinBuilder already uses the "early expansion" and scripts depend on it - hence we can not change it anymore...

booty#1
Go to the top of the page
 
+Quote Post
« Next Oldest · Support and Bug reporting · Next Newest »
 

Fast ReplyReply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

Collapse

> Similar Topics

  Topic Replies Topic Starter Views Last Action
No New Posts Not really sure where to put this...
I'm not sure what the problem is.
6 DaemonForce 112 7th October 2007 - 03:28 PM
Last post by: DaemonForce
No New Posts wb script extension and screensavers
Confict btwn winbuild .scr extension and ScrSaver files
6 thunn 186 30th September 2007 - 04:35 AM
Last post by: thunn
No New Posts Working Scripts???
Need antivirus and antispyware scripts
4 cold20hearted06 277 19th September 2007 - 01:43 PM
Last post by: cold20hearted06
No New Posts wbxpe desktop shortcut? and change ramdisk?
how to change shortcusts and ramdisk
2 carfan 214 16th September 2007 - 01:37 PM
Last post by: carfan
No New Posts Topic has attachmentsBug "VistaPE boots into black screen" and how to fix it
VistaPE v008 bug caused by "wrong" NTFS permissions
5 booty#1 544 14th September 2007 - 07:09 AM
Last post by: booty#1


 

Display Mode: Standard · Switch to: Linear+ · Switch to: Outline

Track this topic · Email this topic · Print this topic · Subscribe to this forum

- Lo-Fi Version Time is now: 12th October 2007 - 04:00 AM

MKPortal ©2003-2006 mkportal.it