HP Forums

Full Version: USING .TXT IN AN APP
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Sorry for the inconvenience, Cyrille de Brebisson, but please if you would show an example of how to use an app to open files in .txt format, when I start writing to send but in txt format, what shipping out, messy

Sorry, but I am not 100% sure that I understand your request...

If what you are trying to do is enter text in an app so that you can exchange that text with the computer, the best solution might be to use Notes, either as independent files using the Notes catalog (shift 0), or as app note (shift apps button).
Then, you can open the file on the connectivity kit and do a copy and paste to a text editor.

If you are using the PC emulator, you can directly use the edit menu copy/paste functions to copy/paste text from the currently opened note to the PC clipboard.

What I mean, that Hp prime, when programmed in the app, there is an option for example to generate images in jpg format.

Then also observe, from one app you can create files in .TXT format
specifically with the command:


If the .TXT format is generated, but you can not read well, it's like missing something
then why my dudad as use correctly

Also hize with a loop and does not work
I have put on the list a request to allow saving/accessing a .txt file from an app variable as a plain text similar to how jpg/png do something a bit different.

Thanks for the suggestion!

Actually, what you are doing when you do:
Is that you are storing a string object in a file called DATO.txt...

You can see that by doing
R->B(AFilesB("DATO.txt", 0, 10)) which will return {#FFh,#FFh,#12h,#CDh,#1h,#0h,#0h,#0h,#31h,#0h}
Here, the FFFF means nothing, the 1 is a flag, the 2 means string, CD is a pad, 1, 0, 0, 0 is the size of the string in characters and 31, 0 is the character 1 in 16 bit wchar...

If you saved something else than a string (a number for example), you would see the binary representation of that number.

If you really wanted to create a text file, you would need to do it using the AFilesB (B stands for binary) in order to save your data.
Alternatively, you could do it with a mix of AFiles and ABilesB, doing something like:
AFiles(name):= string; AFilesB(name):= AFilesB(name, 8, 10000);
which will allow you to use the AFiles function to do the string to number conversion, and then use AFilesB to 'shift' the data down and remove the string header (althrough, come to thing about it, you might need to save the data comming from AFilesB(name, 8, 10000) in a temp var, then delete the file and then write it back)...


Lo logrué con AFiles como indican, a modo de práctica personal pude crear un lector, que permite cargar archivos aún si este pasa el límite de longitud de una cadena, puesto que lo procesa por bloques, mi objetivo era usar menos recursos que los .hpnote, lo que aún me falta es optimizarlo porque va algo lento cuando se trata de archivos grandes, aunque no creo que pueda hacerlo más de lo que ya he intentado, no estoy seguro de cuando lo continuaré, esta casi terminado.

En el video lo muestro, pero nuevamente agradezco a Erwin Ried por PrimeMon, ayuda muchísimo.
Reference URL's