Page 10 of 10

Re: Search and Replace text in a file

PostPosted: Tue Dec 10, 2013 5:14 am
by UltraVox
To be more precise.

It is not possible to call a sub-routine from a button or radio button, in a container.
But, the same action GoSub "AddDir" work if it is in a button in the application, but not in a button that is in the container!

This is very anything... it's two days I'm looking error, then it's not even my fault ...

Re: Search and Replace text in a file

PostPosted: Tue Dec 10, 2013 6:23 am
by UltraVox
I understand.
The error comes from a mistranslation "FR" of NeoBook. The container is set to "ToolWindow+Exclusive", which modifies (apparently) the execution of the sub-routine !

The NB help Translating said exactly this :

Les autres parties de la publication sont suspendues en attendant que la fenêtre soit fermée. Cela vous permet de créer des boîtes de dialogue modales requérant de la part des utilisateurs l'entrée d'informations et la sélection d'options avant de poursuivre.


Other parts of the publication shall be suspended until the window is closed. This allows you to create modal dialog boxes requesting from the user input information and selection options before continuing.


Except that my script first close the window, and THEN execute the Action GoSub :

Syntax: [ Download ] [ Hide ]
Using Neobook Syntax Highlighting
. Close window
CloseCustomWindow "Conteneur11"

If "[Groupe_AddType]" "=" "Files"
   GoSub "AddFiles"
EndIf

If "[Groupe_AddType]" "=" "Directory"
   GoSub "AddDir"
EndIf
 
Parsed in 0.006 seconds, using GeSHi 1.0.8.10

So I followed Neo help, to the letter. I should not have ;)
QED

Re: Search and Replace text in a file

PostPosted: Thu Dec 12, 2013 4:15 am
by UltraVox
Hello all,

I use the mishem script to load the image files that are in a specific directory.
Like this :

Code: Select all
:AddDirToConvert
FolderBox "Select your images directory :" "[SelectedDir]"

  If "[SelectedDir]" "=" ""
     AlertBox "[AppTitle]" "Please, choose a valid directory."
     Return
  Else
      SetVar "[InputMaskAddDir]" "*.BMP;*.IMG;*.PBM;*.PAM;*.PFM;*.BSI;*.CIF;*.DAGSKY;*.DAGTEXTURE;*.DDS;*.GIF;*.JNG;*.JPG;*.JP2;*.MNG;*.PCX;*.PGM;*.PNG;*.PPM;*.PSD;*.TGA;*.TIF;*.XPM"
      zmFindFiles "[InputMaskAddDir]" "[SelectedDir]" "SubFolders" "" "[FilesinFolder]" "Find"
    If "[zmFindFilesCount]" ">" "0"
      Loop "1" "[zmFindFilesCount]" "[I]"
        hpwLine "[FilesinFolder]" "[I]" "[FilePaths]"
        ListBoxFindItem "SourceImagesListBox" "[FilePaths]" "[Result]"
        If "[Result]" "=" "0"
          ListBoxAddItem "SourceImagesListBox" "0" "[FilePaths]"
        EndIf
      EndLoop
    EndIf
  EndIf
Return


I would use a similar script to load the image files from a selection window "multiple" files :
Code: Select all
FileOpenBox "Select one or more images files" "[InputMaskAddFiles]" "[MyDocuments]" "[SelectedFiles]" "Multiple"

Can you help me modify the script to suit my needs, please ?
I did some tests but without success.

Thank you very much.