I think I will just make 1 topic for all of my many questions for ICE. Right now I am wondering why one of my programs can't delete the correct appvar with its name stored in Str2. Instead, the program deletes the wrong AppVars.
Code:
 0->POS
   While (Detect(^^oPOS,"TXT"->CURNAME and (NUMBER<10)

      getKey->K
      CloseAll
      
      //get file info
      Open(CURNAME,"r"->CURFILE
      GetSize(CURFILE->SIZE
      SetArchiveStatus(1,CURFILE
      ''->Str1
      sum(31,Str1,CURFILE

      //display file info
      If SELECTED=NUMBER
         SetColor(0
         FillRectangle_NoClip(35,Y-5,250,15
         SetTextFGColor(246
      Else
         SetTextFGColor(0
      End

      //DISPLAY DETECTED FILES
      PrintStringXY(Str1,40,Y
      SetTextXY(135,Y
      PrintInt(SIZE,4

      ////BUTTON FUNCTIONS
      //DELETE
      If K=51
         Delete(Str1
         Goto HOME
      End

      NUMBER+1->NUMBER
      Y+15->Y
   End


Thank you in advance!
SAX wrote:
<commandblockguy> you probably want to add a check to see if Str1 is the one that's actually selected
<commandblockguy> e.g. If K=51 and SELECTED=NUMBER
<commandblockguy> that way only the selected one will get deleted, not the first file found after the user pressed key 51
<randomguy> thank you, commandblockguy! it worked!
<randomguy> that makes sense now!
Is it possible to delete a string in ICE or at least to delete all the characters from a string? I tried '->Str1 and "->Str1 and ''->Str1 and ""->Str1 but those didn't seem to work. thank you in advance!
Edit: 0->*{Str1} works
how would you start the pos at an offset when detecting files in a shell-like menu as seen above, in order to scroll? I know that the pos is a pointer, not a simple 1,2,3 count, so how would you start searching for files starting after a certain number (ex. searching the files starting from the third file in the vat). As you can see, my program stops displaying the files after the 10th so as to avoid running them off the screen, but when I deleted some files, it updated the detected file names. So all I need is a way to be able to scroll down the file names.


Code:

0->NUMBER
0->POS
   While (Detect(^^oPOS,"TXT"->CURNAME and (NUMBER<10)

      Open(CURNAME,"r"->FILE

      NUMBER+1->NUMBER
   End




Also, How does P_T converted the memory mapped addresses in the pointer section of Ice documentation to hexadecimal?
Here is the section in which he did it:
"
Here is a page with ports for the real-time clock in the 84+ CE. Near the top of the page it says Memory-mapped address: F30000, this means that you can read from these ports as if they were memory by using the F30000 address range. Below you find a list of specific ports. If you wanted to read the current hour count, that page lists it as port 8008. You simply modify the memory mapped address to get F30008. Before you can use this in a pointer, you need to convert it from hexadecimal. Luckily, ICE has a modifier just for that, the scientific E. With this, you should now be able to read the current hour and store it into, for example, A, like this:

{|EF30008→A}
Now you can use that hour however you wish to in your program.
"
I have an Ice program which works fine except sometimes it freezes and then glitches when I try to exit (with 'clear'). The screen breaks into 4 mini versions of itself, and glitches painfully! However, after I press clear again, the program exits and everything is normal. Otherwise the program is mostly fine. I had this problem with my other Ice program but I forgot what I did to get around it. Confused Does anybody else have/had this problem and/or know how to fix it?
Glitch image:

Glitch recording:

Thank you in advance!
Ps. The program looks like it is pale green, but it is actually gray on-calc. Wink
I don't know much about ICE, but based off the symptoms it's possibly a stack issue where the program tries to quit (and so switches the screen back to 16-bit mode), but still has 1 or more un-popped entries on the stack.

Maybe you're doing a Goto out of an If/Then/End or something like that? Doing that is a big no-no, even in raw Basic it causes memory leaks.
yup, that is exactly what I am doing. it is in the middle of 2 nested if statements!
how would I exit if i can't say

Code:

If getKey(51
    goto X
End
JamesV wrote:
I don't know much about ICE, but based off the symptoms it's possibly a stack issue where the program tries to quit (and so switches the screen back to 16-bit mode), but still has 1 or more un-popped entries on the stack.

Maybe you're doing a Goto out of an If/Then/End or something like that? Doing that is a big no-no, even in raw Basic it causes memory leaks.

If statements do not use the stack in ICE.
I'm rusty on Basic, but if I recall correctly, then you don't need the "End" on your example above as there is only one command after the "If". So I think the following would work without a potential memory leak:


Code:

If getKey(51
  Goto X
...
...
...
Lbl X


fghsgh wrote:
If statements do not use the stack in ICE.
Isn't ICE Basic with extra commands, like Axe? If so, then If/Then/End blocks will still use the stack behind the scenes.

I'm not 100% sure, but worth a try anyway Smile
no, it doesn't work
Sorry my bad, I forgot ICE is a compiler and not parsed like Axe was.

Could be an ICE bug as Mateo suggested in chat..
here is a temporary link to the code: http://sc.cemetech.net/?hash=V/QCcTKxhW+PWTzT4FJJvmPoA382
JamesV wrote:
Sorry my bad, I forgot ICE is a compiler and not parsed like Axe was.

Um Axe is a compiler too Very Happy
Big lol, woops Razz Sorry randomguy, I might have given you the run around for nothing!

Although regardless, having Goto inside an If/Then/Else/End is still a bad habit to get into. Unfortunately, TI left a gaping trap for us with their Basic language.
okay, so SourceCoder 3 was compiling fine until a couple days ago. Now, whenever I press the compile button, it just says Javascript:void(0). why is that, and how can I fix that? Question


Exclamation Edit: There was a syntax error (I had an extraneous '/'), but SourceCoder 3's built in compiler didn't show it. I had to click on 'check' to see what was wrong.

By the way, is it true that all prime numbers are either 1 or 5 above a multiple of 6 (besides 2 and 3 and 5)?
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement