Source language: Translate to:

Find the six file names in quotation marks (eg: "image.jpg")

General questions about NeoBook

Moderator: Neosoft Support

Find the six file names in quotation marks (eg: "image.jpg")

Postby UltraVox » Tue Jul 01, 2014 1:16 am

Hello everyone !

In your opinion, how to recover the six file names (images) that are in a DirectX file (*.x), always with quotation marks (eg "image1.dds").

The image names can be anything else (if not, it would not be a problem to find them). I am looking for a method to find the 6 names of files in this example (DirectX file below).

Rate this :
The six images are always in quotation marks (eg: "image.dds")
I would like to retrieve the six names, then place them in different variables.

I mess a little...
Thank you for your help !

Code: Select all
xof 0303txt 0032

Material Material__6 {
 1.000000;1.000000;1.000000;1.000000;;
 0.000000;
 0.000000;0.000000;0.000000;;
 0.000000;0.000000;0.000000;;

 TextureFilename  {
  "clear_D.dds";
 }
}

Material Material__2 {
 1.000000;1.000000;1.000000;1.000000;;
 0.000000;
 0.000000;0.000000;0.000000;;
 0.000000;0.000000;0.000000;;

 TextureFilename  {
  "clear_R.dds";
 }
}

Material Material__1 {
 1.000000;1.000000;1.000000;1.000000;;
 0.000000;
 0.000000;0.000000;0.000000;;
 0.000000;0.000000;0.000000;;

 TextureFilename  {
  "clear_B.dds";
 }
}

Material Material__5 {
 1.000000;1.000000;1.000000;1.000000;;
 1.600000;
 0.000000;0.000000;0.000000;;
 0.000000;0.000000;0.000000;;

 TextureFilename  {
  "clear_U.dds";
 }
}

Material Material__4 {
 1.000000;1.000000;1.000000;1.000000;;
 0.000000;
 0.000000;0.000000;0.000000;;
 0.000000;0.000000;0.000000;;

 TextureFilename  {
  "clear_L.dds";
 }
}

Material Material__3 {
 1.000000;1.000000;1.000000;1.000000;;
 0.000000;
 0.000000;0.000000;0.000000;;
 0.000000;0.000000;0.000000;;

 TextureFilename  {
  "clear_F.dds";
 }
}

Frame down {
 

 FrameTransformMatrix {
  1.000000,0.000000,0.000000,0.000000,0.000000,1.000000,0.000000,0.000000,0.000000,0.000000,1.000000,0.000000,0.000015,0.000011,0.000009,1.000000;;
 }

 Mesh  {
  6;
  5.000000;-5.000000;4.999998;,
  5.000000;-4.999998;-5.000000;,
  -5.000000;-5.000000;4.999998;,
  -5.000000;-4.999998;-5.000000;,
  -5.000000;-5.000000;4.999998;,
  5.000000;-4.999998;-5.000000;;
  2;
  3;0,1,2;,
  3;3,4,5;;

  MeshNormals  {
   6;
   0.000000;1.000000;0.000000;,
   0.000000;1.000000;0.000000;,
   0.000000;1.000000;0.000000;,
   0.000000;1.000000;0.000000;,
   0.000000;1.000000;0.000000;,
   0.000000;1.000000;0.000000;;
   2;
   3;0,1,2;,
   3;3,4,5;;
  }

  MeshMaterialList  {
   1;
   2;
   0,
   0;
   { Material__6 }
  }

  MeshTextureCoords  {
   6;
   0.999501;0.000499;,
   0.999501;0.999501;,
   0.000500;0.000499;,
   0.000500;0.999501;,
   0.000500;0.000499;,
   0.999501;0.999501;;
  }
 }
}

Frame right {
 

 FrameTransformMatrix {
  1.000000,0.000000,0.000000,0.000000,0.000000,1.000000,0.000000,0.000000,0.000000,0.000000,1.000000,0.000000,0.000015,0.000011,0.000009,1.000000;;
 }

 Mesh  {
  6;
  5.000000;4.999998;5.000000;,
  5.000000;5.000000;-4.999997;,
  5.000000;-5.000000;4.999998;,
  5.000000;-4.999998;-5.000000;,
  5.000000;-5.000000;4.999998;,
  5.000000;5.000000;-4.999997;;
  2;
  3;0,1,2;,
  3;3,4,5;;

  MeshNormals  {
   6;
   -1.000000;0.000000;0.000000;,
   -1.000000;0.000000;0.000000;,
   -1.000000;0.000000;0.000000;,
   -1.000000;0.000000;0.000000;,
   -1.000000;0.000000;0.000000;,
   -1.000000;0.000000;0.000000;;
   2;
   3;0,1,2;,
   3;3,4,5;;
  }

  MeshMaterialList  {
   1;
   2;
   0,
   0;
   { Material__2 }
  }

  MeshTextureCoords  {
   6;
   0.000499;0.000499;,
   0.999501;0.000499;,
   0.000499;0.999501;,
   0.999501;0.999501;,
   0.000499;0.999501;,
   0.999501;0.000499;;
  }
 }
}

Frame front {
 

 FrameTransformMatrix {
  1.000000,0.000000,0.000000,0.000000,0.000000,1.000000,0.000000,0.000000,0.000000,0.000000,1.000000,0.000000,0.000015,0.000011,0.000009,1.000000;;
 }

 Mesh  {
  6;
  5.000000;-4.999998;-5.000000;,
  5.000000;5.000000;-4.999997;,
  -5.000000;-4.999998;-5.000000;,
  -5.000000;5.000000;-4.999997;,
  -5.000000;-4.999998;-5.000000;,
  5.000000;5.000000;-4.999997;;
  2;
  3;0,1,2;,
  3;3,4,5;;

  MeshNormals  {
   6;
   0.000000;-0.000000;1.000000;,
   0.000000;-0.000000;1.000000;,
   0.000000;-0.000000;1.000000;,
   0.000000;-0.000000;1.000000;,
   0.000000;-0.000000;1.000000;,
   0.000000;-0.000000;1.000000;;
   2;
   3;0,1,2;,
   3;3,4,5;;
  }

  MeshMaterialList  {
   1;
   2;
   0,
   0;
   { Material__1 }
  }

  MeshTextureCoords  {
   6;
   0.000500;0.999500;,
   0.000500;0.000500;,
   0.999500;0.999500;,
   0.999500;0.000500;,
   0.999500;0.999500;,
   0.000500;0.000500;;
  }
 }
}

Frame up {
 

 FrameTransformMatrix {
  1.000000,0.000000,0.000000,0.000000,0.000000,1.000000,0.000000,0.000000,0.000000,0.000000,1.000000,0.000000,0.000015,0.000011,0.000009,1.000000;;
 }

 Mesh  {
  6;
  -5.000000;4.999998;5.000000;,
  -5.000000;5.000000;-4.999997;,
  5.000000;4.999998;5.000000;,
  5.000000;5.000000;-4.999997;,
  5.000000;4.999998;5.000000;,
  -5.000000;5.000000;-4.999997;;
  2;
  3;0,1,2;,
  3;3,4,5;;

  MeshNormals  {
   6;
   0.000000;-1.000000;-0.000000;,
   0.000000;-1.000000;-0.000000;,
   0.000000;-1.000000;-0.000000;,
   0.000000;-1.000000;-0.000000;,
   0.000000;-1.000000;-0.000000;,
   0.000000;-1.000000;-0.000000;;
   2;
   3;0,1,2;,
   3;3,4,5;;
  }

  MeshMaterialList  {
   1;
   2;
   0,
   0;
   { Material__5 }
  }

  MeshTextureCoords  {
   6;
   0.000499;0.999500;,
   0.000499;0.000499;,
   0.999501;0.999500;,
   0.999501;0.000499;,
   0.999501;0.999500;,
   0.000499;0.000499;;
  }
 }
}

Frame Left {
 

 FrameTransformMatrix {
  1.000000,0.000000,0.000000,0.000000,0.000000,1.000000,0.000000,0.000000,0.000000,0.000000,1.000000,0.000000,0.000015,0.000011,0.000009,1.000000;;
 }

 Mesh  {
  6;
  -5.000000;-5.000000;4.999998;,
  -5.000000;-4.999998;-5.000000;,
  -5.000000;4.999998;5.000000;,
  -5.000000;5.000000;-4.999997;,
  -5.000000;4.999998;5.000000;,
  -5.000000;-4.999998;-5.000000;;
  2;
  3;0,1,2;,
  3;3,4,5;;

  MeshNormals  {
   6;
   1.000000;0.000000;0.000000;,
   1.000000;0.000000;0.000000;,
   1.000000;0.000000;0.000000;,
   1.000000;0.000000;0.000000;,
   1.000000;0.000000;0.000000;,
   1.000000;0.000000;0.000000;;
   2;
   3;0,1,2;,
   3;3,4,5;;
  }

  MeshMaterialList  {
   1;
   2;
   0,
   0;
   { Material__4 }
  }

  MeshTextureCoords  {
   6;
   0.999501;0.999501;,
   0.000499;0.999501;,
   0.999501;0.000499;,
   0.000499;0.000499;,
   0.999501;0.000499;,
   0.000499;0.999501;;
  }
 }
}

Frame back {
 

 FrameTransformMatrix {
  1.000000,0.000000,0.000000,0.000000,0.000000,1.000000,0.000000,0.000000,0.000000,0.000000,1.000000,0.000000,0.000015,0.000011,0.000009,1.000000;;
 }

 Mesh  {
  6;
  -5.000000;4.999998;5.000000;,
  5.000000;4.999998;5.000000;,
  -5.000000;-5.000000;4.999998;,
  5.000000;-5.000000;4.999998;,
  -5.000000;-5.000000;4.999998;,
  5.000000;4.999998;5.000000;;
  2;
  3;0,1,2;,
  3;3,4,5;;

  MeshNormals  {
   6;
   0.000000;0.000000;-1.000000;,
   0.000000;0.000000;-1.000000;,
   0.000000;0.000000;-1.000000;,
   0.000000;0.000000;-1.000000;,
   0.000000;0.000000;-1.000000;,
   0.000000;0.000000;-1.000000;;
   2;
   3;0,1,2;,
   3;3,4,5;;
  }

  MeshMaterialList  {
   1;
   2;
   0,
   0;
   { Material__3 }
  }

  MeshTextureCoords  {
   6;
   0.000500;0.000500;,
   0.999500;0.000500;,
   0.000500;0.999500;,
   0.999500;0.999500;,
   0.000500;0.999500;,
   0.999500;0.000500;;
  }
 }
}
UltraVox
 
Posts: 419
Joined: Sat Jul 28, 2007 11:14 am
Location: France

Re: Find the six file names in quotation marks (eg: "image.j

Postby Gaev » Tue Jul 01, 2014 5:14 am

UltraVox:

Some clarification required ...

1) Is what you have posted above the content of the DirectX file ? ... i.e. is it just a text file that can be read via the FileRead command ?

2) does it matter if the file names ...

- do not start with "clear_" ?
- do not end with ".dds ?

... you can use StrParse (with delimiter of [#34]) to create an array variable ... then loop through all of the array items ... ignoring ...

- the first one
- ones that start with a ;

If necessary, do further checks and ignore ones that do not start/end with specified characters

If the requirement is different, please provide details.

If you need sample code, ask here.
User avatar
Gaev
 
Posts: 3737
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Re: Find the six file names in quotation marks (eg: "image.j

Postby virger » Tue Jul 01, 2014 10:28 am

HI, from COSTA RICA.

1) I'll take the text to read it as a treat variable "Text" and so do the procedure.
2) I assume the "Text" always has the same "format"
3) This is the process to execute

Code: Select all
StrParse "[Text]" "TextureFilename  {" "[Data]" "[X]"
SetVar "[Text]" ""
SetVar "[Data1]" ""
SetVar "[N]" "1"
Loop "2" "[X]" "[C]"
    StrParse "[Data[C]]" "[#34]" "[Temp]" "[Y]"
    ... SetVar "[Data[N]]" "[Temp2]"
    SetVar "[Text]" "[Text][n]) [Temp2][#13]"
    Math "[N]+1" "" "[N]"
EndLoop
SetVar "[Text]" "[Text]Ready"
SetVar "[Data[C]]" ""
SetVar "[N]" ""
SetVar "[X]" ""
SetVar "[Y]" ""
SetVar "[C]" ""
DeleteArray "[Temp]" "All"



THE MAKING HISTORY
COSTA RICA
NEXT HOLLAND
COSTA RICA
PURA VIDA
User avatar
virger
 
Posts: 524
Joined: Mon Sep 18, 2006 12:21 pm
Location: Costa Rica, America Central

Re: Find the six file names in quotation marks (eg: "image.j

Postby UltraVox » Thu Jul 03, 2014 8:45 am

Hello Gaev,

1) Is what you have posted above the content of the DirectX file ? ... i.e. is it just a text file that can be read via the FileRead command ?


Yes, DirectX files (*.x) are in text format. The FileRead command works perfectly with this file type.

2) does it matter if the file names ...

- do not start with "clear_" ?
- do not end with ".dds ?


Filenames are always different and also for file extensions. I need a method that seeks 6 file names in the directx.x file. Imagine a method to systematically find the six file names, whoever they are and whatever their extensions. In addition, we must remember each file name in a different variable, like : [FileName1], [FileName2], [FileName3], [FileName4], [FileName5] and [FileName6].

It's a bit complicated at first, but I am convinced that NeoBook is more than capable of doing. :roll:
UltraVox
 
Posts: 419
Joined: Sat Jul 28, 2007 11:14 am
Location: France

Re: Find the six file names in quotation marks (eg: "image.j

Postby UltraVox » Thu Jul 03, 2014 8:52 am

Virger,

I'll try your code, but I'm not sure I understand everything (because no comments in the code).
There are 6 files to find...

We'll see what happens :)
Thank you for your help.
UltraVox
 
Posts: 419
Joined: Sat Jul 28, 2007 11:14 am
Location: France

Re: Find the six file names in quotation marks (eg: "image.j

Postby dec » Thu Jul 03, 2014 9:29 am

Hello,

What about the use of Regular Expressions?

Maybe my npRexp plugin can help you Ultravox.
.
Enhance your NeoBook applications!
.
58 plugins, 1131 actions and 233 samples
.
NeoPlugins website: www.neoplugins.com
.
User avatar
dec
 
Posts: 1663
Joined: Wed Nov 16, 2005 12:48 am
Location: Spain

Re: Find the six file names in quotation marks (eg: "image.j

Postby virger » Thu Jul 03, 2014 10:18 am

Hola Desde
COSTA RICA
Somos PURA VIDA
~~~~~~~~~~~~~~~~

Con base al FORMATO del file "Direct-X"
Ver este link (http://paulbourke.net/dataformats/directx/#xfilefrm_Template_MeshMaterialList),
se debe tener en cuenta que la directriz: "Template Name: TextureFilename" tiene esta estructura:

TextureFilename {
"FileNameTextura.ext";
}


Por lo que se puede utilizar siempre como DELIMITADOR del comando "StrParse",
de ahi que mi propuesta sea para cualquier "FileName_File-Ditect-X" y dentro de este
encontrar todos los "TextureFileName.Ext", que haya sin importar su extension

Adjunto programa completo

=====================
Based on the FORMAT file "Direct-X"
See this link (http://paulbourke.net/dataformats/directx/%20#%20xfilefrm_Template_MeshMaterialList)
should note that the guideline: "Template Name: TextureFilename" has this structure:

TextureFilename {
"FileNameTextura.ext";
}


As you can always use as the DELIMITER "StrParse" command,
hence my proposal is for any "FileName_File-ditect-X" and within this
find all "TextureFileName.Ext" there regardless of their extension

Under full program


Code: Select all
{NeoBook 5 Objects}
NeoBookVer=5,80
ObjectType=9
Name=EnText
X=32
Y=42
W=120
H=143
Anchor=0
VarName=[text]
Align=1
EditMultiLine=Yes
WordWrap=No
EditLen=0
LineColor=0
LineWidth=1
LineStyle=0
FillColor=12632256
FillPattern=0
Font=Arial
FontSize=10
FontStyle=0
FontCharset=1
TextColor=0
TabOrder=1
ObjectType=3
Name=BtExecute
X=123
Y=3
W=71
H=35
Anchor=0
Text=List Files
Align=2
ImageStyle=0
ObjAction=.. Leer archivo en formato ASCII¶FileOpenBox "File [#34]Direct-X[#34] A Procesar" "File|*.*" "" "[File]" ""¶.. Valida Texto¶If "[File]" "=" ""¶    GotoLine "NoVa"¶endif¶FileRead "[File]" "All" "[Text]"¶¶... opcional, crear file con lista de FileNames¶setvar "[nFile]" "[File]"¶ChangeFileExt "[File]" ".Dat" "[File]"¶FileWrite "[File]" "All" "From File: [nFile]"¶¶..Separa con base en Delimitador 'TextureFilename  {'¶StrParse "[Text]" "TextureFilename  {" "[Data]" "[nLineas]"¶¶..Libera memoria del [Text] /opcional¶SetVar "[Text]" ""¶¶..Elimina [Data1]/opcional¶SetVar "[Data1]" ""¶¶... Inicializa contador de "FileNames"¶SetVar "[nFile]" "1"¶¶..Incio en '2' (se descarto Data1)¶Loop "2" "[nLineas]" "[Count]"¶.. [#34], es el delimitador dentro de la directriz¶..              TextureFilename {¶..              "FileNameTextura.ext";¶..              }¶    StrParse "[Data[Count]]" "[#34]" "[nPart]" "[XX]"¶¶    ... Guarda el "FileName,Ext" en misma variable¶    SetVar "[Data[nFile]]" "[nPart2]"¶¶    ... Guarda lista de "FileName.Ext" en variable "Text"¶    ... para usar en TextEntry o en ListBox¶    SetVar "[Text]" "[Text][nFile]) [nPart2][#13]"¶¶    ... opcional, guarda el ListBox¶    ListBoxAddItem "ListFiles" "0" "[nFile]) [nPart2]"¶¶    ... Escribir a File/ opcional¶    FileWrite "[File]" "Append" "[nFile]) [nPart2]"¶¶    Math "[nFile]+1" "" "[nFile]"¶EndLoop¶SetVar "[Text]" "[Text]Ready"¶¶.. Libera variables¶SetVar "[Data[Count]]" ""¶SetVar "[nFile]" ""¶SetVar "[File]" ""¶setvar "[xx]" ""¶SetVar "[nLineas]" ""¶DeleteArray "[nPart]" "All"¶¶:NoVa
LineColor=0
LineWidth=1
LineStyle=0
FillColor=12632256
FillPattern=0
Font=Arial
FontSize=10
FontStyle=0
FontCharset=1
TextColor=0
TabOrder=3
ObjectType=10
Name=ListFiles
X=172
Y=42
W=113
H=141
Anchor=0
VarName=[xFile]
VarType=0
LineColor=0
LineWidth=1
LineStyle=0
FillColor=12632256
FillPattern=0
Font=Arial
FontSize=10
FontStyle=0
FontCharset=1
TextColor=0
TabOrder=4


GRACIAS POR LA ATENCION
THANKS FOR ATTENTION
COSTA RICA
PURA VIDA
User avatar
virger
 
Posts: 524
Joined: Mon Sep 18, 2006 12:21 pm
Location: Costa Rica, America Central

Re: Find the six file names in quotation marks (eg: "image.j

Postby dec » Thu Jul 03, 2014 10:23 am

Hello,

I modified the "Simple search.pub" sample included in the npRexp plugin to shown how can be useful here.

You can download the publication sample and their compiled binary from this link:

http://neoplugins.com/Humm/Sites/Main/V ... RegExp.zip

Image
.
Enhance your NeoBook applications!
.
58 plugins, 1131 actions and 233 samples
.
NeoPlugins website: www.neoplugins.com
.
User avatar
dec
 
Posts: 1663
Joined: Wed Nov 16, 2005 12:48 am
Location: Spain

Re: Find the six file names in quotation marks (eg: "image.j

Postby UltraVox » Thu Jul 03, 2014 11:56 am

You all offer very good examples! Your help is invaluable.

Question for Dec :
I have not studied your code deeply, but if you certify to me that the variable [Str] can give me the six file names, and it is possible to integrate them into six special variables, I bought your plugin. I need it because my application will be compatible with DirectX (Load and Edit).

Can you assure me that this is possible ?

Thank you all for your help :mrgreen:
UltraVox
 
Posts: 419
Joined: Sat Jul 28, 2007 11:14 am
Location: France

Re: Find the six file names in quotation marks (eg: "image.j

Postby dec » Thu Jul 03, 2014 12:01 pm

Hello,

UltraVox wrote:Question for Dec :
I have not studied your code deeply, but if you certify to me that the variable [Str] can give me the six file names, and it is possible to integrate them into six special variables, I bought your plugin. I need it because my application will be compatible with DirectX (Load and Edit).

Can you assure me that this is possible ?

Thank you all for your help :mrgreen:


Absolutely. Do you see the sample? Take a look at it, since include the binary executable, where you can see in action.

Download it from this link:

http://neoplugins.com/Humm/Sites/Main/V ... RegExp.zip

Also take a look here at the code of the Search button in the sample, which implement all the needed code:

Code: Select all
.Create our Regular Expression engine
npRexpCreate "[RexpID]"

.Specify the regular expresion we want to search
npRexpStr "[RexpID]" "[Expresion]" "[Result]"

.Execute the first time the regular expresion engine
npRexpExec "[RexpID]" "[Text]" "[Result]"

.If the last action result is True, we are found the regexp
If "[Result]" "=" "True"

  .So we want to iterate over all occurences of the regexp
  While "[Result]" "=" "True"

    .Retrieve the matched string
    npRexpMatchstr "[RexpID]" "1" "[Str]"
   
    .Do whatever thing with [Str], which is a found file name
    .For this sample we only show the founded file name
    AlertBox "Found" "[Str]"

   .Execute again the regular expresion engine over the same regexp
   .begignning from the position of the last regexp found on the string
    npRexpExecNext "[RexpID]" "[Result]"

   .The while is looping until we found more regexp occurences
   .When no more occurences is found, the last action result is "False"
  EndWhile

Else

  AlertBox "Info" "No results found"
EndIf

.We no need anymore the object, so destroy it
npRexpDestroy "[RexpID]" "[Result]"


As you can see in the above code, we create the Regular Expression Engine, provide the appropiate regular expression and the source text to search in, and, finally, execute the regular expression agains that source text. As you can see the sample is limitated to show in an "AlertBox" every file name found in the source text. In a real application, of course, you can take such variable and use it for whatever thing instead to only be shown in the "AlertBox".

Anyway try it by yourself and, if need some help, do not hesitate to contact me or place here another post. ;)
.
Enhance your NeoBook applications!
.
58 plugins, 1131 actions and 233 samples
.
NeoPlugins website: www.neoplugins.com
.
User avatar
dec
 
Posts: 1663
Joined: Wed Nov 16, 2005 12:48 am
Location: Spain

Re: Find the six file names in quotation marks (eg: "image.j

Postby UltraVox » Thu Jul 03, 2014 2:49 pm

This is good. The plugin works perfectly with all my directx files. :wink:
Now, it is imperative to integrate the 6 filenames found in 6 special variables, such as [Texture1], [Texture2], [Texture3], [Texture4], [Texture5] and [Texture6].

And the solution will be complete :)
UltraVox
 
Posts: 419
Joined: Sat Jul 28, 2007 11:14 am
Location: France

Re: Find the six file names in quotation marks (eg: "image.j

Postby dec » Thu Jul 03, 2014 3:43 pm

Hello,

Thanks very much again for your support Ultravox. ;)

Please, open the above sample publication, double click on the Search button and replace the "Left click" code by this other:

Code: Select all
.Create our Regular Expression engine
npRexpCreate "[RexpID]"

.Initialize our matched count variable (to later prepare the result array)
SetVar "[Count]" "0"

.Delete a possible previously set file names array result variable
DeleteArray "[Texture]" "All"

.Specify the regular expresion we want to search
npRexpStr "[RexpID]" "(?-g)TextureFilename  {.+[#34](.*)[#34];.+}" "[Result]"

.Execute the first time the regular expresion engine
npRexpExec "[RexpID]" "[Text]" "[Result]"

.If the last action result is True, we are found the regexp
If "[Result]" "=" "True"

  .So we want to iterate over all occurences of the regexp
  While "[Result]" "=" "True"

    .Increment our matched count variable
    SetVar "[Count]" "[Count]+1"

    .Retrieve the matched string
    npRexpMatchstr "[RexpID]" "1" "[FileName]"

    .Store this matched file name into our array result variable
    SetVar "[Texture[Count]]" "[FileName]"

   .Execute again the regular expresion engine over the same regexp
   .begignning from the position of the last regexp found on the string
    npRexpExecNext "[RexpID]" "[Result]"

   .The while is looping until we found more regexp occurences
   .When no more occurences is found, the last action result is "False"
  EndWhile
 
Else
  .TODO: maybe we want to do something else here?
  AlertBox "Info" "No results found"
EndIf

.We no need anymore the object, so destroy it
npRexpDestroy "[RexpID]" "[Result]"

.Clear certain no more used variables
ClearVariables "RexpID,FileName,Count,Result"


As you can see now, instead of shown the file names into an "AlertBox", we store the file names into a "[Texture]" array variable, just like you wanted. Note how the code is also a little refactoring and enhanced: now certain unused variables are clear when finish; also we hardwrite our regular expression. In fact the only variable we use now which reside out of the above code is "[Text]", where the source text is placed. ;)

Take a look at what the NeoBook debugger shows after the above code is executed:

Image
.
Enhance your NeoBook applications!
.
58 plugins, 1131 actions and 233 samples
.
NeoPlugins website: www.neoplugins.com
.
User avatar
dec
 
Posts: 1663
Joined: Wed Nov 16, 2005 12:48 am
Location: Spain

Re: Find the six file names in quotation marks (eg: "image.j

Postby UltraVox » Thu Jul 03, 2014 11:09 pm

But this is paradise ! :)

With this new feature, my program can now Load and Edit a DirectX file ;)

Assemble all the textures of a 3D object (CubeMapping and others) and to walk around in a 3D space with a 3D engine, now it works :-)

Thank you very much David, and all those who helped me :)

Sincerely,
UltraVox
 
Posts: 419
Joined: Sat Jul 28, 2007 11:14 am
Location: France

Re: Find the six file names in quotation marks (eg: "image.j

Postby dec » Fri Jul 04, 2014 12:20 am

Hello,

Glad to know you got it! And always thanks you for your support Ultravox. ;)
.
Enhance your NeoBook applications!
.
58 plugins, 1131 actions and 233 samples
.
NeoPlugins website: www.neoplugins.com
.
User avatar
dec
 
Posts: 1663
Joined: Wed Nov 16, 2005 12:48 am
Location: Spain


Return to General NeoBook Discussions

Who is online

Users browsing this forum: No registered users and 1 guest