07-23-2018 05:36 AM
bonjour,
comment je peux creer un fichier et envoyer des informations qui sont deja dans le buffer ?
merci d'avance
07-23-2018 05:52 AM
You can write to files either using CVI Formatting and I/O Library functions (OpenFile, WriteFile, WriteLine, CloseFile) or the equivalent standard functions from the ANSI C library (fopen, fputs, fclose); each library offers additions functions for specific tasks.
The CVI library is a bit more user fiendly but is not portable if you intend to reuse your code in a compiler different from the CVI one.
07-23-2018 06:24 AM
ces fonctions permet d'ouvrir ou d'écrire dans un fichier mais comment je peux creer un fichier txt ?
07-23-2018 07:20 AM
je veux que le fichier soit cree dans un dossier particulié
07-23-2018 06:18 PM
@chayma ha scritto:
ces fonctions permet d'ouvrir ou d'écrire dans un fichier mais comment je peux creer un fichier txt ?
There is really nothing different between a .txt file and other files with regard to handling: you open, write and close them with the usual commands, appropriately defining the specific attributes for that file type (pass VAL_ASCII to OpenFile command or select one of the available file types in fopen: "w", "a" or other).
07-23-2018 06:20 PM
@chayma ha scritto:
je veux que le fichier soit cree dans un dossier particulié
You can use FileSelectPopup or FileSelectPopupEx to let the user choose a destination for the file to be created: the commands will return the full pathname to pass to openFile or fopen.
Alternatively you can use MakePathname to generate the pathname of the file to be created.
07-23-2018 06:26 PM
As a last suggestion, it is preferable that in this international board you use the English language. Users of this board usually do not speak French (neither do I) and relying on automatic translators could lead to misunderstanding and errors.
If you do not speak English, French boards exist where you can post in your native language.
07-23-2018 11:31 PM
thanks
can you give me an exemple for using FileSelectPopupEx or FileSelectPopup ?
07-24-2018 06:02 AM
Hello chayma,
normally I would suggest you to search in the example finder (Help >> Find examples... menu function), but it returns no results for those functions.
As an alternative, more direct way of getting help, you can do this: write down the command you want to investigate and press Ctrl+P (or right-click on the command and select Recall function panel, which is the same): the function panel window will open with the required parameters for the selected command (you can right-click on each of the parameters exposed to look at the help for it). Now right-click on a empty area of the function panel window and you will get the help for the whole function: if any example exists that makes use of it, it will be listed at the bottom of that window, with a button that will open a new CVI instance with the suggested project. In your case, FileSelectPopupEx help will list 7 examples for yo to study.
You can use this method to look for examples on a specific CVI function.
07-26-2018 04:48 AM
ok thanks ^^