Jump to content











Photo
- - - - -

equal or not equal?


  • Please log in to reply
18 replies to this topic

#1 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 08 January 2009 - 04:05 PM

Variables and WB, a constant source of joy to me! :)

Did you know that,

If,%C%,NotEqual,,Command
and
If,%C%,NotEqual,"",Command

are not the same to WB! :) :)

Peter, i sure hope you have fixed this nonsense in the WB Betas!


:)

#2 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 08 January 2009 - 04:39 PM

I give up! Would someone please tell me, what the heck is wrong with this line!

IniRead,"%ProjectDir%\script.project","Variables","#$pActiveShell#$p","%Shell%"

I checked, that the file is found and that the section is found. Both are OK.
Yet i can't read the value! :)

:)

PS: I use WB072, incase this is important.

#3 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 08 January 2009 - 05:17 PM

And the :) solution. :)
Out of pur desperation i tryed something i saw yesterday in pedrole15 api.script. I thought it was an error then!
Pedro sorry for doubting you :)

If,ExistFile,"%ProjectDir%\script.project",Command
If,ExistSection,"%ProjectDir%\script.project","Variables",Command
BUT
IniRead,"%ProjectDir%script.project","Variables","#$pActiveShell#$p","%ActiveShell%"

Saw it? In IniRead one is not allowed to use a \! :) :)



:)

Reason for edit: Complete nonsense!!!

#4 pscEx

pscEx

    Platinum Member

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

Posted 08 January 2009 - 05:51 PM

Variables and WB, a constant source of joy to me! :)

Did you know that,

If,%C%,NotEqual,,Command
and
If,%C%,NotEqual,"",Command

are not the same to WB! :) :)

Peter, i sure hope you have fixed this nonsense in the WB Betas!


:)

On my system
[variables]

%c%=

%a%=""



[process]

if,%a%,equal,,Echo,a_none

if,%a%,equal,"",Echo,a_quotes

if,%c%,equal,,Echo,c_none

if,%c%,equal,"",Echo,c_quotes
results with:

Posted Image Processing section: [process]
Posted Image File [%BaseDir%\Projects\nativeEx_barebone_075\CodeBox.txt] Version [1]

Posted Image IF - [] is equal to: [] evaluated string: [if,%a%,equal,,Echo,a_none]
Posted Image a_none
Posted Image IF - [] is equal to: [] evaluated string: [if,%a%,equal,"",Echo,a_quotes]
Posted Image a_quotes
Posted Image IF - [] is equal to: [] evaluated string: [if,%c%,equal,,Echo,c_none]
Posted Image c_none
Posted Image IF - [] is equal to: [] evaluated string: [if,%c%,equal,"",Echo,c_quotes]
Posted Image c_quotes

Posted Image Finished processing script: CodeBox test

Posted Image Script time: 4 seconds and 250 miliseconds

Posted Image Script has been sucessfully processed!


Peter

#5 pscEx

pscEx

    Platinum Member

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

Posted 08 January 2009 - 06:01 PM

And the :) solution. :)
Out of pur desperation i tryed something i saw yesterday in pedrole15 api.script. I thought it was an error then!
Pedro sorry for doubting you :)

If,ExistFile,"%ProjectDir%\script.project",Command
If,ExistSection,"%ProjectDir%\script.project","Variables",Command
BUT
IniRead,"%ProjectDir%script.project","Variables","#$pActiveShell#$p","%ActiveShell%"

Saw it? In IniRead one is not allowed to use a \! :) :)


:)

The correct command is:

IniRead,"%ProjectDir%\script.project","Variables","##$pActiveShell##$p","%ActiveShell%"

Posted Image Processing section: [process]
Posted Image File [%BaseDir%\Projects\nativeEx_barebone_075\CodeBox.txt] Version [1]

Posted Image IniRead - [%BaseDir%\Projects\nativeEx_barebone_075\script.project] Section [Variables] Key [%ActiveShell%] to variable: [%var%] with value [%BaseDir%\Projects\nativeEx_Core\Basic\Shells\Explorer.Script]
Posted Image %BaseDir%\Projects\nativeEx_Core\Basic\Shells\Explorer.Script

Posted Image Finished processing script: CodeBox test

Posted Image Script time: 219 miliseconds

Posted Image Script has been sucessfully processed!

Peter

#6 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 08 January 2009 - 06:57 PM

Thanks Peter that you already replyed.
Cause i wanted to post that my finding regarding the IniRead is not correct.
WB was just tricking me.

I had several times success with different tests, but none worked longer than 5 times. :)
How can commands work just a few times? :)


Those stupid values can not be read in any way, not even yours!!! :)
The only times things seem to work, was when i used by accident the same variable name that was written to script.project.
In that case the variable was directly used but the value was never ever read by IniRead!

Now somebody please explain to me why! Before i get :)


:)

#7 pscEx

pscEx

    Platinum Member

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

Posted 08 January 2009 - 08:03 PM

Thanks Peter that you already replyed.
Cause i wanted to post that my finding regarding the IniRead is not correct.
WB was just tricking me.

I had several times success with different tests, but none worked longer than 5 times. :)
How can commands work just a few times? :)


Those stupid values can not be read in any way, not even yours!!! :)
The only times things seem to work, was when i used by accident the same variable name that was written to script.project.
In that case the variable was directly used but the value was never ever read by IniRead!

Now somebody please explain to me why! Before i get :)


:)

The value name is %ActiveShell%, but when reading, %ActiveShell% is replaced by the actual content, something with explorer.script.

You finally read:
IniRead,<ProjectDir>\script.project,Variables,C:\Path\explorer.script,%targetVar%

And the value name 'C:\Path\explorer.script' is not defined in the variables section. :)

This tricky situation has been the reason for me to introduce 'Escape of Escape' (##$p).

Peter

#8 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 08 January 2009 - 08:35 PM

If i understand you right, then the older stable versions of WB will not allow me to ever read Any value from an ini that looks like a variable %blabla%?

The point i'm not quit getting about this is, if i use %blabla% to ask for the value, WB is right to resolve the variable, but why should it do that, if i ask for #$pblabla#$p? Shouldn't that be just another string to it?


:)

#9 pscEx

pscEx

    Platinum Member

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

Posted 08 January 2009 - 08:53 PM

The point i'm not quit getting about this is, if i use %blabla% to ask for the value, WB is right to resolve the variable, but why should it do that, if i ask for #$pblabla#$p? Shouldn't that be just another string to it?

This discussion belongs to the topics I yesterday meant with this topic

Peter

#10 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 08 January 2009 - 09:09 PM

:) No Peter i don't want to discuss with you any ideas! I just wanna understand what's going wrong.


:)

#11 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 08 January 2009 - 10:05 PM

Last one for today. I promise! :)

How do i check for a key in the registry, that may or may not exist, with WB072?

I thought, i simply try to read the key and look if it did contain something.
Worked good so far, except when the key does not exist, i can't unmount the hive afterwards anymore.
Wont even work with regedit as long as WB is still running! :)

Any clever ideas?


:)

#12 pscEx

pscEx

    Platinum Member

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

Posted 08 January 2009 - 10:13 PM

Last one for today. I promise! :)

How do i check for a key in the registry, that may or may not exist, with WB072?

I thought, i simply try to read the key and look if it did contain something.
Worked good so far, except when the key does not exist, i can't unmount the hive afterwards anymore.
Wont even work with regedit as long as WB is still running! :)

Any clever ideas?


:)

If I remember correctly WB072 is nearly from the time when I was forced to replace DOS by WIN301 :)
Seriously: No idea. I remember that I have had similar troubles (with 074, too).

Sorry. Surviving is hard for Dinosaurs!

Peter :)

#13 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 08 January 2009 - 10:21 PM

Sorry. Surviving is hard for Dinosaurs!


Ahh, that's your plan, to wait with the release of a new stable till we all died out! :)


:)

#14 pscEx

pscEx

    Platinum Member

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

Posted 08 January 2009 - 10:38 PM

Ahh, that's your plan, to wait with the release of a new stable till we all died out! :)

Inspite I'm sometimes playing with this idea, I never said something similar!

And maybe Nunu reads this.
He is the boss to publish.
And we already agreed one week ago that there a 'intermediate' beta must be published to try to find all the 'server move' lost features
(During that time also the develop SVN was not accessible for two weeks)

Peter

EDIT: Just Lancelote informed me that the 'Language' mechanism is lost ...
And here is something serious, but not unsolvable wrong:

Captions and ToolTips in the new Lang function are confused.

Just some hours to resolve ...

Maybe you have an idea what I do tomorrow.

@booty#1: I think that is a bottle of Cognac worth! :)

Peter

#15 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 08 January 2009 - 11:45 PM

Just in case anyone cares.

IniRead,%ProjectDir%\script.project,Variables,#$pActiveShell#$p,%Shell%

Works as long as the script does not know a variable called %ActiveShell%. Don't ask me why! :)


:)

#16 pscEx

pscEx

    Platinum Member

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

Posted 09 January 2009 - 10:41 AM

Just in case anyone cares.

IniRead,%ProjectDir%\script.project,Variables,#$pActiveShell#$p,%Shell%

Works as long as the script does not know a variable called %ActiveShell%. Don't ask me why! :)


:)


Probier mal:
&#91;process&#93;

Echo,%Unbekannt%

Echo,#$pUnbekannt#$p

Echo,##$pUnbekannt##$p

Set,%unbekannt%,bekannt

Echo,%Unbekannt%

Echo,#$pUnbekannt#$p

Echo,##$pUnbekannt##$p

Peter

#17 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 09 January 2009 - 10:56 AM

The result of the test is as it should be.
WB_Error.gif


:)

#18 pscEx

pscEx

    Platinum Member

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

Posted 09 January 2009 - 11:08 AM

And this is the result with 075 beta 5 =:

Posted Image Processing section: [process]
Posted Image File [%BaseDir%\Projects\nativeEx_barebone_075\CodeBox.txt] Version [1]

Posted Image %Unbekannt%
Posted Image %Unbekannt%
Posted Image #$pUnbekannt#$p
Posted Image SetVar - Sucessfuly changed the value of [%unbekannt%] to: [bekannt]
Posted Image bekannt
Posted Image %Unbekannt%
Posted Image #$pUnbekannt#$p

Posted Image Finished processing script: CodeBox test

Posted Image Script time: 219 miliseconds

Posted Image Script has been sucessfully processed!

Peter

#19 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 09 January 2009 - 12:50 PM

Sorry Peter, but i miss the point of this test, we knew before that you introduced in WB075 new double escapes.

This does not explain, why WB would come up with the idea to resolve a string into a variable.

Yet i figured out, why it works when the variable name is not known.
Different to any other language i know of, if a variable is not initialized by setting it to some value in WB, it gets handled like a string.

I could use in this case eigther one of those two lines successfully:
IniRead,%ProjectDir%\script.project,Variables,#$pActiveShell#$p,%Shell%
IniRead,%ProjectDir%\script.project,Variables,%ActiveShell%,%Shell%


:)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users