Announcement

Collapse
No announcement yet.

File Rename bug ??

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • File Rename bug ??

    I don't use this option much or not at all really so a little confusion, its saying the file does not exist but the file path is right

    Code:
    if ComboBox.GetItemData(this, e_Selection) == "true" then
        File.Rename(_SourceFolder.."\\data\\.minecraft\\mods\\OptiFine_1.10.2_HD_U_E3.jar", _SourceFolder.."\\data\\.minecraft\\mods\\OptiFine_1.10.2_HD_U_E3.dis");
    else
        File.Rename(_SourceFolder.."\\data\\.minecraft\\mods\\OptiFine_1.10.2_HD_U_E3.dis", _SourceFolder.."\\data\\.minecraft\\mods\\OptiFine_1.10.2_HD_U_E3.jar");
    end
    
    --Check to see if an error occurred.
    error = Application.GetLastError();
    
    -- If an error occurred, display the error message.
    if (error ~= 0) then
        Dialog.Message("Error", _tblErrorMessages[error].." (".._SourceFolder.."\\data\\.minecraft\\mods\\OptiFine_1.10.2_HD_U_E3.jar)", MB_OK, MB_ICONEXCLAMATION);
    end
    Can anyone see why File Rename would opt to say the file is not there?
    Plugins or Sources MokoX
    BunnyHop 2021 Here

  • #2
    It's a bug File.Rename and File.DoesExist don't fire there commands on combo box's on 8.2
    Plugins or Sources MokoX
    BunnyHop 2021 Here

    Comment


    • #3
      try
      result= ComboBox.GetItemData(this, e_Selection)
      if result == "true" then

      Comment


      • #4
        Originally posted by colc View Post
        try
        result= ComboBox.GetItemData(this, e_Selection)
        if result == "true" then
        That as no impact changing it from short hand to long hand its the problem of fireing of functions full stop the get item is working tested it with
        a dialog to make sure we was getting the right info.
        Plugins or Sources MokoX
        BunnyHop 2021 Here

        Comment


        • #5
          kingzooly you are right I should have used " nSelected " not e_selection
          your code would never be right as it could never return "true", please read documentation
          Click image for larger version

Name:	ComboBox Properties_ ComboBox1.jpg
Views:	27
Size:	36.7 KB
ID:	298256
          cheers

          Comment


          • #6
            Originally posted by colc View Post
            kingzooly you are right I should have used " nSelected " not e_selection
            your code would never be right as it could never return "true", please read documentation
            [ATTACH=CONFIG]n298256[/ATTACH]
            cheers
            I guessing you have no idea what GetItem does the function returns "true" or "false" from what is in the combo box I now know what it's meant to be returning as I have tested it,you need to read the manual I have made loads of apps and plugins for AMS, You have not idea what your talking about and your really getting on my tit now!

            You read the the manual and come back to me when when you know what your talking about, I think you need to look up the users Sim and Rexzooly, and you will know I been a posting member since 2007, I know how to code in this software with the best of them, since the code works else where and with all other code part from File functions I can clearly say this is a bug that might of been fixed after 8.2 but I posted it anyway incase it was over looked.

            Please read the manual yourself and even test code before commenting as your comment was wrong, 100% wrong as the combo box does return "true" and "false" or in some combos "shim" or "mc" "" = string, so the function is checking it it returned that string and this is working fine.
            Plugins or Sources MokoX
            BunnyHop 2021 Here

            Comment


            • #7
              Yes I remember U from earlier days, can't remember too many snippets!
              code widely used
              Code:
              nSelected = ComboBox.GetSelected("ComboBox1");
              if nSelected then
              
                  sCategory = ComboBox.GetItemData("ComboBox1", nSelected);
                  Label.SetText("Label_Category", sCategory);
                  
              ListBox.DeleteItem("ListBox1", -1);
              
                  if sCategory == "Slow" then
                      ListBox.DeleteItem("ListBox1", -1);
              from manual
              Click image for larger version

Name:	combo.png
Views:	54
Size:	24.1 KB
ID:	298291

              Comment


              • #8
                Once again your the one not reading I am checking for a string that is what == "true", means if I was looking for a boolean it would == true what are you not getting, you reply is wrong so please just listen or read

                Code:
                 
                 if ComboBox.GetItemData(this, e_Selection) == "true" then
                This is checking the GetItemData for a string NOT a boolen as this statement would look like so

                Code:
                 
                 if ComboBox.GetItemData(this, e_Selection) == true then
                Once again I already said all over commands work all other parts of my code work only problem I was getting was the File commands FFS when someone tells you it works don't try and prove them bloody wrong, that part of the code is fine, 100% fine it works! that same check I use right now for other things it's the File functions don't fire or return right!
                Plugins or Sources MokoX
                BunnyHop 2021 Here

                Comment


                • #9
                  kingzooly My sincere apologies I misread your first post
                  You are right there is a bug when you type Items Text / Item Data into the combobox, but works if you load both at On Show
                  see attached filerename.apz
                  Sorry again
                  Cheers

                  Comment


                  • #10
                    I already swapped out the combo box for radio check box's work and look better for my needs anyway, not a problem but please understand I been doing things in AMS what is not even designed to do, I sometimes forget simple things but It's rare that I not tested things a lot before posting about it here.
                    Plugins or Sources MokoX
                    BunnyHop 2021 Here

                    Comment


                    • #11
                      Originally posted by colc View Post
                      [USER="56521"]see attached [ATTACH]n298294[/ATTACH]
                      I see your using a plugin I can't even get hold of anymore, CS's plugings was epic back when.
                      Plugins or Sources MokoX
                      BunnyHop 2021 Here

                      Comment


                      • #12
                        Sorry it was centaurisoldiers GlobalPaths plugin? Was using to test paths forgot to remove. Do U want
                        did U see the prob when items typed in?

                        Comment


                        • #13
                          Originally posted by colc View Post
                          Sorry it was centaurisoldiers GlobalPaths plugin? Was using to test paths forgot to remove. Do U want
                          did U see the prob when items typed in?
                          I see that AMS has a very strange bug for sure, Do you have the collection of Centaurisoldiers Plugins I grabed them when he made them all downloadable but lost them all when I stopped using AMS for a while but he as some good plugins wouldlnt might getting my hands on them again
                          Plugins or Sources MokoX
                          BunnyHop 2021 Here

                          Comment

                          Working...
                          X