Hello,
I think it would be easier for you to use the CAAFile library instead of Sysfile.
The File.Open FB of the CAA_File library will directly return a string with the content of your file. You can find examples here.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks for the input. I tried working with CAA file and the examples but i did not managed to come up with a solution. I first opened a directory and then a opened file but can't copy a value to a string, out of it. Could you may be tell me what function should I use exactly use or an example for the problem? Thanks
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You can use the "Read" functionality. When you call this (after you opened the file succesfully), the result is written in the buffer you have assigned when you call the Read function. Then it reads the amount of the size of the buffer, of if the file is smaller than the buffer, the whole file. From this buffer, you can use other functions to find the string you are looking for.
So in the example at the top, the variable "Data" will contain the contents you read from the file.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You can use the "Read" functionality. When you call this (after you opened the file succesfully), the result is written in the buffer you have assigned when you call the Read function. Then it reads the amount of the size of the buffer, of if the file is smaller than the buffer, the whole file. From this buffer, you can use other functions to find the string you are looking for.
So in the example at the top, the variable "Data" will contain the contents you read from the file.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I want to create a program to extract value from a file and create a sting (later I would want to use this string as an input value).
Also i found this solution to open the file and read the values. But I did not managed to make a string.
Please help.
Last edit: master-student 2022-06-22
Hello,
I think it would be easier for you to use the CAAFile library instead of Sysfile.
The File.Open FB of the CAA_File library will directly return a string with the content of your file. You can find examples here.
Hi,
Thanks for the input. I tried working with CAA file and the examples but i did not managed to come up with a solution. I first opened a directory and then a opened file but can't copy a value to a string, out of it. Could you may be tell me what function should I use exactly use or an example for the problem? Thanks
You can use the "Read" functionality. When you call this (after you opened the file succesfully), the result is written in the buffer you have assigned when you call the Read function. Then it reads the amount of the size of the buffer, of if the file is smaller than the buffer, the whole file. From this buffer, you can use other functions to find the string you are looking for.
So in the example at the top, the variable "Data" will contain the contents you read from the file.
You can use the "Read" functionality. When you call this (after you opened the file succesfully), the result is written in the buffer you have assigned when you call the Read function. Then it reads the amount of the size of the buffer, of if the file is smaller than the buffer, the whole file. From this buffer, you can use other functions to find the string you are looking for.
So in the example at the top, the variable "Data" will contain the contents you read from the file.
Thanks, I am trying to use the GVL examples but I am getting the following error "C0077: Unknown type: 'CAA_FILENAME'. any idea?
Last edit: master-student 2022-06-26
Last edit: master-student 2022-06-26
Last edit: master-student 2022-06-26