Author Topic: Help with Files  (Read 3351 times)

0 Members and 1 Guest are viewing this topic.

Offline ACagliano

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 919
  • Rating: +32/-2
    • View Profile
    • ClrHome Productions
Help with Files
« on: December 21, 2010, 10:17:03 am »
I know that Axe has support for creating files of variables in Archive, so that they can be read (y-vars), but I am not quite sure how to create the files, then how to reference, read from, and write to them once they have been created. Help, anyone?

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: Help with Files
« Reply #1 on: December 21, 2010, 10:33:15 am »
Code: [Select]
:"appvNAME"?Str1
:GetCalc(Str1)??
:!If ?
:UnarchiveStr1
:GetCalc(Str1)??End
:!If ?
:GetCalc(Str1,[desired size])??END

Take a look at that code...

Also, check this topic. That topic has quite a lot of information, the above code was very useful to me :)

Offline ACagliano

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 919
  • Rating: +32/-2
    • View Profile
    • ClrHome Productions
Re: Help with Files
« Reply #2 on: December 21, 2010, 10:41:08 am »
Yes. I know how to do that. But, I'm referring something else, involving not Unarchiving the variable. It involves the variables Y1-Y0.

Offline Fast Crash

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 192
  • Rating: +45/-7
  • Virus of tomorrow
    • View Profile
Re: Help with Files
« Reply #3 on: December 21, 2010, 01:16:33 pm »
by using files Y0 Y1 ... you can only read the appvar (not store numbers in it)
Code: [Select]
Getcalc(NAME",Y0)
Disp {Y0}r>Dec
Disp {Y0+1}>Dec
...

Offline ACagliano

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 919
  • Rating: +32/-2
    • View Profile
    • ClrHome Productions
Re: Help with Files
« Reply #4 on: December 21, 2010, 01:17:48 pm »
Ah, ok. That would help for games, when I need to read from a map without editing it.

Does Y0 take up RAM?

Offline Fast Crash

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 192
  • Rating: +45/-7
  • Virus of tomorrow
    • View Profile
Re: Help with Files
« Reply #5 on: December 21, 2010, 01:25:33 pm »
i don't know, but i don't think so (it wouln't be interesting  :P )
« Last Edit: December 21, 2010, 01:29:25 pm by Fast Crash »

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Help with Files
« Reply #6 on: December 21, 2010, 01:31:13 pm »
They do take up some RAM, but i believe they are in a secret free memory spot hidden in the OS, so they use up none of the L1-L6 pieces of RAM, nor do they use up any of user RAM

Note that with the Y1 files, you can only read from archive, you cannot create files, delete files, or much anything else wesides read from archive.