Author Topic: Using Files (Y0 - Y9) in Axe  (Read 2372 times)

0 Members and 1 Guest are viewing this topic.

Offline Rollum78

  • LV2 Member (Next: 40)
  • **
  • Posts: 36
  • Rating: +5/-0
  • Sodium
    • View Profile
Using Files (Y0 - Y9) in Axe
« on: December 14, 2012, 02:31:31 pm »
I have an appVar in Archive and want to compare its first bytes with a string:
Code: [Select]
:.APPARCH
:"TEST"[00]->Str1
:ClrHome
:If GetCalc("appvRANDOM",Y0)         //that Y0 in [VARS] [Y-VARS] [Function]
:!If Equ>String(Y0,Str1)                  //"Invalid File Use"
:Output(0,0,"Erfolg")
:Else
:Output(0,0,"Nichts")
:End
:End
:getkey[sup]r[/sup]
:ClrHome

When i try to compile that i get an "Invalid File Use" error.
Is what i am trying even possible without unarchiving the appVar?
Or would i have to loop through each byte and compare those individually?
Sachs'e nix mehr, hm?

Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: Using Files (Y0 - Y9) in Axe
« Reply #1 on: December 14, 2012, 02:33:34 pm »
Well, you can use a for loop, but there is another way to do this without unarchiving the appvar: copy its first bytes (those you want to compare) to a free RAM area and then, use Equ>String on this area :)
(don't forget to put the zero at the end of your copied first bytes ;))

Copy works with files but Equ>String doesn't
I own: 83+ ; 84+SE ; 76.fr ; CX CAS ; Prizm ; 84+CSE
Sorry if I answer with something that seems unrelated, English is not my primary language and I might not have understood well. Sorry if I make English mistakes too.

click here to know where you got your last +1s

Offline Rollum78

  • LV2 Member (Next: 40)
  • **
  • Posts: 36
  • Rating: +5/-0
  • Sodium
    • View Profile
Re: Using Files (Y0 - Y9) in Axe
« Reply #2 on: December 14, 2012, 02:50:17 pm »
Copy works with files but Equ>String doesn't

Thanks! That is helping me a lot :)
Sachs'e nix mehr, hm?