Jump to content

Bug Or Something?


Recommended Posts

Regardless of that, he is still declaring a variable as a parameter within the function and then declaring it as a Local variable within the same function. Whether he is using beta or not that is going to give him an error. He needs to fix the syntax before it will run with beta or not.

How do i do that then?I'm not so intelligent :D

Link to comment
Share on other sites

  • Moderators

Regardless of that, he is still declaring a variable as a parameter within the function and then declaring it as a Local variable within the same function. Whether he is using beta or not that is going to give him an error. He needs to fix the syntax before it will run with beta or not.

I don't see how you see that to be honest... He hasn't showed but 1 string function _StringReverse() and it looks like he passes that parameter ok. The error shows him maybe playing with the _StringEncrypt()...??

@Immense - Are you even using _StringEncrypt() in any other part of your script?

Here is my Beta String.au3, try replacing it with yours.

(Might even replace both the standard and the Beta\Include\String.au3 one with it just to see).

Edit:

Also, $fileGet[0] have you debugged that yet? Doesn't that only return the number of elements in the StringSplit(), was that your goal?

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

C:\Program Files\AutoIt3\Include\String.au3(16,59) : ERROR: $strHex already declared as parameter
    Local $strChar, $aryHex, $i, $iDec, $Char, $file, $strHex,
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Program Files\AutoIt3\Include\String.au3(60,112) : ERROR: $i_EncryptLevel already declared as parameter
      If Number($i_EncryptLevel) <= 0 Or Int($i_EncryptLevel) <> $i_EncryptLevel Then Local $i_EncryptLevel = 1
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~^
ERROR: $strHex already declared as parameter

Func _HexToString($strHex)

Local $strChar, $aryHex, $i, $iDec, $Char, $file, $strHex
oÝ÷ ÛMú²ÚÇ{¬uç%j·jƪºij¶¦z׫ªê-§jëh×6
Func _HexToString($strHex)
oÝ÷ Ùh^*.vaÆ®¶­s`¤Æö6Âb33c·7G$6"Âb33c¶'WÂb33c¶Âb33c¶FV2Âb33c´6"Âb33c¶fÆRÂb33c·7G$W

you get the error because it is already declared as a "parameter", understand?

Edit: and yes, you need beta if you're not using it, but that's not going to cause the error I just showed you.

Edited by Nomad
Link to comment
Share on other sites

  • Moderators

Edit: and yes, you need beta if you're not using it, but that's not going to cause the error I just showed you.

Actually it does solve the issue, because the beta include doesn't have the parameters also being declared as Local. That's why I kept telling him to use Beta, but if he played with the Beta #include then there is no telling what the issue could be now :D :D

Damn, with all the posts in here from us 3, it looks like a freaking mad house :P ...

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Actually it does solve the issue, because the beta include doesn't have the parameters also being declared as Local. That's why I kept telling him to use Beta, but if he played with the Beta #include then there is no telling what the issue could be now :D :D

Damn, with all the posts in here from us 3, it looks like a freaking mad house ;) ...

Oh, he's using UDF's and that's what those functions are causing the errors? LOL, I thought he wrote them. Yeah, this thread is getting kindof long though. :P

Link to comment
Share on other sites

I don't see how you see that to be honest... He hasn't showed but 1 string function _StringReverse() and it looks like he passes that parameter ok. The error shows him maybe playing with the _StringEncrypt()...??

@Immense - Are you even using _StringEncrypt() in any other part of your script?

Here is my Beta String.au3, try replacing it with yours.

(Might even replace both the standard and the Beta\Include\String.au3 one with it just to see).

Edit:

Also, $fileGet[0] have you debugged that yet? Doesn't that only return the number of elements in the StringSplit(), was that your goal?

Good Morning :D , It worked! That Include file you gave me fixed the problem :D.

I don't know what _StringEncrypt() is.. and i ain't using _StringEncrypt().

The $fileGet[0] is exactly what i want to do, i want the number of strings, and get the last array.

Oh wait, i accidently changed that....

It should be:

$fileName   =   $fileGet[$fileGet[0]]

So the $fileName equals to the last ($fileGet[0]) array from $fileGet which is example: notepad.txt

Well, thnx for everything guys :P

- ImMenSe

Edited by Immense
Link to comment
Share on other sites

If Number($i_EncryptLevel) <= 0 Or Int($i_EncryptLevel) <> $i_EncryptLevel Then $i_EncryptLevel = 1

WHy not this?

maybe it works

--------------------------------------------------------------------------------------------------------------------------------Scripts : _Encrypt UDF_UniquePCCode UDF MS like calculatorInstall programm *UPDATED* --------------------------------------------------------------------------------------------------------------------------------[quote name='Helge' post='213117' date='Jul 26 2006, 10:22 AM']Have you ever tried surfing the internet with a milk-carton ?This is similar to what you're trying to do.[/quote]

Link to comment
Share on other sites

hey,

I couldn't find the things you said, soo....

;;      .Au3 Includes       ;;
#include <GUIConstants.au3>
#include <String.au3>
#include <File.au3>

;;      Setup       ;;
Global $width   =   @DesktopWidth/2
Global $height  =   @DesktopHeight/2
Global $title   =   "File Converter Program"
Global $handle  =   GUICreate($title,$width,$height)

Global $file_data   =   "feed.dat"
Global $file_map    =   "Files"

;;      Menu's Create       ;;
$menu_file  =   GUICtrlCreateMenu("File")

;;      Menu File Items     ;;
$menu_file_add  =   GUICtrlCreateMenuitem("Add File",$menu_file)

If (FileExists($file_data)) Then
    If (_FileCountLines($file_data)>0) Then
        $menu_file_load =   GUICtrlCreateMenu("Load File",$menu_file)
    EndIf
Else
    _FileCreate($file_data)
EndIf

$menu_file_exit =   GUICtrlCreateMenuitem("Exit",$menu_file)
GUISetState(@SW_SHOW,$handle)

While 1
    $event  =   GUIGetMsg()
    
    Select
        Case $event = $GUI_EVENT_CLOSE Or $event = $menu_file_exit
            Exit
            
        Case $event = $menu_file_add
            func_add_file()
    EndSelect
WEnd

Exit

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Func func_add_file()
    $fileOpen   =   FileOpenDialog("Add a file",@WorkingDir,"All Files (*.*)",1+2)
    
    If @error = 0 Then
        $fileGet    =   StringSplit($fileOpen,"\")
        $fileName   =   $fileGet[$fileGet[0]]
        $fileType   =   StringRight($fileName,3)
        
        FileWrite(@ScriptDir&"/"&$file_data&"/",$fileType&" | "&$fileOpen&@CRLF)
        
        $string     =   FileRead($fileOpen,FileGetSize($fileOpen))
        
        $stringLeft =   StringLeft($string,30)
        $stringLeft =   _StringReverse($stringLeft)

        $string     =   $stringLeft & StringTrimLeft($string,30)

        FileWrite(@WorkingDir&$file_map&,$string)
    EndIf
EndFunc

Hope you or someone else find the bug :D

-ImMenSe

this script is working OK with the beta if you correct

FileWrite(@WorkingDir&$file_map&,$string)

to

FileWrite(@WorkingDir&$file_map  , $string)

Just a question how did you post the code? Under which Browser are you running?

I need this information to understand why some AutoiT code post are OK to be copy and paste and other not as yours.

Thanks for the help :D

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...