2009-08-28 08:09 AM
2009-08-28 10:49 AM
2009-08-28 11:22 AM
2009-08-28 12:01 PM
2009-08-28 12:15 PM
2009-08-28 01:17 PM
Braza wrote:
Ok Alex... Everything is on the right place.
Don't know much about I/O operations...
But... First thing I have noticed is that you are not using the appropriate filter... As told in the GDL Manual:
Specifying Folder
channel = OPEN (filter, filename, paramstring)
channel : folder id
filter : the internal name of the Add-On, in this case "FileMan"
filename : - the name of folder to be scanned (OS dependent path) - folder id string (in
DIALOG mode - see later)
paramstring : Add-on specific parameter.
The parameters in paramString must be separated by commas (,).
1. parameter: FILES/FOLDERS
What would you like to search for?
2. parameter (optional): DIALOG
Indicates that the folder is given by a file id string instead of a file path.
When this is the case, at the first time (and each time when the corresponding file path seems
to be invalid) the user will be faced a dialog box to set the id string - file path
correspondence, which will be stored.
And you used "TEXT"...
If you post the object folder here I'll take a look later...
2009-08-30 11:23 AM
2009-08-31 10:53 PM
!--> file names added f1= "File01.txt" f2= "File02.txt" f3= "File03.txt" !--> LIBRARY keyword added ch1 = open ("TEXT", f1, "mode = ro,LIBRARY") ch2 = open ("TEXT", f2, "separator = '\n', mode = wo,LIBRARY") ch3 = open ("TEXT", f3, "separator = '\n', mode = wo,LIBRARY") !--> script continues as before i = 1 1: n = input (ch1, i, 1, var1, var2, var3, var4) if n <> -1 then output ch2, 1, 0, var1, var2, var3, var4 output ch3, 1, 0, var1, var2, var3, var4 i = i + 1 goto 1 else goto 2 endif 2: close ch1 close ch2 close ch3 end
2009-09-02 08:14 AM
Juha wrote:It Works! Thank you!
Hello,
I do not know about the PDF manual, but would suggest declaring the file names first and then using the LIBRARY keyword meaning that the files are in the active libraries. I tested and this works, just remember to load the file library.
!--> file names added f1= "File01.txt" f2= "File02.txt" f3= "File03.txt" !--> LIBRARY keyword added ch1 = open ("TEXT", f1, "mode = ro,LIBRARY") ch2 = open ("TEXT", f2, "separator = '\n', mode = wo,LIBRARY") ch3 = open ("TEXT", f3, "separator = '\n', mode = wo,LIBRARY") !--> script continues as before i = 1 1: n = input (ch1, i, 1, var1, var2, var3, var4) if n <> -1 then output ch2, 1, 0, var1, var2, var3, var4 output ch3, 1, 0, var1, var2, var3, var4 i = i + 1 goto 1 else goto 2 endif 2: close ch1 close ch2 close ch3 end
Hope this helps.