HP Forums
USING .TXT IN AN APP - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: HP Prime (/forum-5.html)
+--- Thread: USING .TXT IN AN APP (/thread-6967.html)

USING .TXT IN AN APP - ROBERT - 10-03-2016 06:02 AM

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

RE: USING .TXT IN AN APP - cyrille de brébisson - 10-04-2016 05:21 AM


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.


RE: USING .TXT IN AN APP - ROBERT - 10-04-2016 12:31 PM

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

RE: USING .TXT IN AN APP - Tim Wessman - 10-04-2016 03:21 PM

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!

RE: USING .TXT IN AN APP - cyrille de brébisson - 10-05-2016 06:52 AM


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)...



RE: USING .TXT IN AN APP - Carlos295pz - 02-06-2018 05:33 AM

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.