Post Reply 
USING .TXT IN AN APP
10-05-2016, 06:52 AM
Post: #5
RE: USING .TXT IN AN APP
Hello,

Actually, what you are doing when you do:
AFiles("DATO.txt"):="1"
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)...

Cyrille

Cyrille

Although I work for the HP calculator group, the views and opinions I post here are my own. I do not speak for HP.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
USING .TXT IN AN APP - ROBERT - 10-03-2016, 06:02 AM
RE: USING .TXT IN AN APP - ROBERT - 10-04-2016, 12:31 PM
RE: USING .TXT IN AN APP - Tim Wessman - 10-04-2016, 03:21 PM
RE: USING .TXT IN AN APP - cyrille de brébisson - 10-05-2016 06:52 AM
RE: USING .TXT IN AN APP - Carlos295pz - 02-06-2018, 05:33 AM
RE: USING .TXT IN AN APP - DrEureka - 07-06-2023, 08:16 PM
RE: USING .TXT IN AN APP - HPCarnace - 07-07-2023, 03:18 AM



User(s) browsing this thread: 1 Guest(s)