careca

StringInStr <> 0 but still else

11 posts in this topic

#1 ·  Posted (edited)

 

Hi, Maybe it's late, maybe i don't know what im doing, all i know is that $Str is different than 0, first result for me is '*' but still does 'Else'.

Im puzzled.

Local $sVar, $i = 1

Do
    $sVar = RegEnumKey("HKCR", $i)
    If @error <> 0 Then ExitLoop
    $Str = StringInStr($sVar, '.')
    If $Str <> 0 Then
    ConsoleWrite("Value Name  #" & $i & " under in AutoIt3 key " & $sVar &' - '&@MSEC&@CRLF)
    $i = $i + 1
    Else
    $i = 'Done'
    EndIf
Until $i = 'Done'

any idea what is going on? From what i get, if stringinstr fails to find the '.' it should output 0.

Edited by careca

Spoiler

Paster - Main function is to paste text, but has more functions.

OpenW - Open With... alternative, Open any file with any application, set it's icon, set application as default.

Renamer - Rename files and folders, remove portions of text from the filename etc.

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Firefox Profile Backup - Backup/restore previously saved profile.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Share this post


Link to post
Share on other sites



Oh crap, i figured it out, first key in registry is *, so of course there it isn't a dot. i need to go to sleep.

1 person likes this

Spoiler

Paster - Main function is to paste text, but has more functions.

OpenW - Open With... alternative, Open any file with any application, set it's icon, set application as default.

Renamer - Rename files and folders, remove portions of text from the filename etc.

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Firefox Profile Backup - Backup/restore previously saved profile.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Share this post


Link to post
Share on other sites

Just so that this topic isn't totally useless, here's what i just done:

Local $sVar, $sVar2,$sVar3,$sVar4, $Str, $Str2, $i = 2

Do
    $sVar = RegEnumKey("HKCR", $i)
    If @error <> 0 Then ExitLoop
    $Str = StringInStr($sVar, '.')
    If $Str <> 0 Then
        For $u = 1 To 5
            $sVar2 = RegEnumKey("HKCR\" & $sVar, $u)
            If @error <> 0 Then ExitLoop
            $Str2 = StringInStr($sVar2, 'OpenWithList', 2)
            If $Str2 <> 0 Then
                For $v = 1 To 5
                    $sVar3 = RegEnumKey("HKCR\" & $sVar & '\' & $sVar2, $v)
                    If @error <> 0 Then ExitLoop
                    $sVar4 = RegRead("HKCR\" & $sVar & '\' & $sVar2 & '\' & $sVar3, '')
                    If $sVar4 <> '' Then
                    ConsoleWrite("HKCR\" & $sVar & '\' & $sVar2&'\' & $sVar3 &'\' &$sVar4 &' - ' & @MSEC & @CRLF)
                    EndIf
                Next
            EndIf
        Next
        $i = $i + 1
    Else
        $i = 'Done'
    EndIf
Until $i = 'Done'

Provides a list of the 'OpenWithList' executables with corresponding path, for the extension.


Spoiler

Paster - Main function is to paste text, but has more functions.

OpenW - Open With... alternative, Open any file with any application, set it's icon, set application as default.

Renamer - Rename files and folders, remove portions of text from the filename etc.

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Firefox Profile Backup - Backup/restore previously saved profile.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Share this post


Link to post
Share on other sites
2 hours ago, careca said:

need to go to sleep

I almost asked why you were comparing a $Str with a number, tired assumptions are fun.


,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

was the joke not painfully obvious?

who names their number $String?

Edited by iamtheky
1 person likes this

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Share this post


Link to post
Share on other sites
39 minutes ago, iamtheky said:

was the joke not painfully obvious?

who names their number $String?

My apologies. I'm afraid i do not interpret humor well through text.

And from experience i can tell you, when depraved of sleep there is no guarantee that anything makes sense.

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

Certainly nothing is going to make sense if you're depraved...

Spoiler

Word.jpg

 

Edited by JLogan3o13
1 person likes this

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

#9 ·  Posted

10 minutes ago, JLogan3o13 said:

Certainly nothing is going to make sense if you're depraved...

  Reveal hidden contents

Word.jpg

 

You called? :blink:

1 person likes this

 

Spoiler

shoot_zpsfd329d66.png
dontbelieveeverythingyouthink_zps0e1e900

Madness is the first step to understanding...

Share this post


Link to post
Share on other sites

#10 ·  Posted

Hello. nothing important. but why comparing this way "If @error<>0 then" . Just do it like "if If @error then"...

 

 

Saludos

Share this post


Link to post
Share on other sites

#11 ·  Posted

Yeah. Either way is fine to me, sometimes i do one, other times i do the other. :P


Spoiler

Paster - Main function is to paste text, but has more functions.

OpenW - Open With... alternative, Open any file with any application, set it's icon, set application as default.

Renamer - Rename files and folders, remove portions of text from the filename etc.

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Firefox Profile Backup - Backup/restore previously saved profile.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now