xboxscene.org forums

Pages: 1 2 [3] 4 5

Author Topic: The Official Filemanager Topic  (Read 642 times)

geniusalz

  • Archived User
  • Hero Member
  • *
  • Posts: 1635
The Official Filemanager Topic
« Reply #30 on: June 03, 2004, 09:53:00 AM »

BJ: Any idea whether you'll implement searching natively or not?
Logged

Yuyu

  • Archived User
  • Hero Member
  • *
  • Posts: 908
The Official Filemanager Topic
« Reply #31 on: June 03, 2004, 10:27:00 AM »

Wouldn't a "bubble sort" be easy to do with actionscript ?

and if searching is not done natively, isn't there a way to do a binary and/or linear search with actionscripting ?

Don't know, just actually asking here...
Logged

BenJeremy

  • Archived User
  • Hero Member
  • *
  • Posts: 5645
The Official Filemanager Topic
« Reply #32 on: June 03, 2004, 11:33:00 AM »

Well, seems like there's a need for a bubble sort (though the data organization/variable naming makes things difficult), maybe I'll look at adding something.

As for searching, what exactly do you mean?
Logged

muerte

  • Archived User
  • Sr. Member
  • *
  • Posts: 359
The Official Filemanager Topic
« Reply #33 on: June 03, 2004, 12:02:00 PM »

QUOTE (geniusalz @ Jun 3 2004, 12:53 PM)
BJ: Any idea whether you'll implement searching natively or not?

Can't you do something like this in actionscripting (sorry for the c++ biggrin.gif)?

CODE
// max - is upper limit
// search - is just an array
// wanted - is what you're searching for
for(int x = 0; x < max; x++)
if(search
  • ==wanted)
     return(T);


Second thing, BJ... will you add all the essential actionscripts (ie filemanager) right into the next release?  I'm sure many people will be happier to see it already included, instead of having to download them seperately.  Plus, you can take the functions added by these actionscripts, and put them on the next feature list.  Just a suggestion.
Logged

BenJeremy

  • Archived User
  • Hero Member
  • *
  • Posts: 5645
The Official Filemanager Topic
« Reply #34 on: June 03, 2004, 12:23:00 PM »

Well, for buffers, I'll speed things up with a SEARCH subfunction to return the offset of a given byte or sequence of bytes in a memory buffer starting at a given offset (for multiple searches).

I don't know if this is the search he's referring to, though.

As for including the file manager in the internal.xml, I'd like to do that, but there will be other considerations as well. I need to add cropping to images, so a single source image can be used to hold all the icons.

I am also looking into expressions (using () for numerical values - see notes in ActionScriptReadMe.txt) and access of memory buffers as variables with array indices.
Logged

flattspott

  • Archived User
  • Hero Member
  • *
  • Posts: 1220
The Official Filemanager Topic
« Reply #35 on: June 03, 2004, 01:56:00 PM »

CODE
First
:BUILDSORTTABLE
Set SortTable 0123456789abcdefghijklmnopqrstuvwxyz
SetFunc SortCount Length %SortTable%
For I = 0 To %SortCount%
  SetFunc Char%I% Mid %I% 1 %SortTable%
Next
Return

Then when searching

  SetFunc sName Replace "*\\" "" %sName%
  SetFunc ToSort Replace "%CurrentDir%" "" %sName%
  SetFunc ToSort Left 1 %ToSort%
  If %ToSort% == %Char{SortValue}% Then
Logged

geniusalz

  • Archived User
  • Hero Member
  • *
  • Posts: 1635
The Official Filemanager Topic
« Reply #36 on: June 03, 2004, 02:19:00 PM »

That's just considering one character.  

Proper sorting could be done in the script, but it tends to get slow with large lists.  The "IF" command, if I remember correctly, can compare strings.
Logged

flattspott

  • Archived User
  • Hero Member
  • *
  • Posts: 1220
The Official Filemanager Topic
« Reply #37 on: June 03, 2004, 02:19:00 PM »

QUOTE
I don't know if this is the search he's referring to, though.


I believe what everyone is talking about is the File Searching stuff.  Mainly the way it seems to find whatever files it finds randomly, AFile, CDir, RDir, FFile etc.
Logged

flattspott

  • Archived User
  • Hero Member
  • *
  • Posts: 1220
The Official Filemanager Topic
« Reply #38 on: June 03, 2004, 02:21:00 PM »

biggrin.gif

I think it'll be too complex for me to try doing it.
Logged

geniusalz

  • Archived User
  • Hero Member
  • *
  • Posts: 1635
The Official Filemanager Topic
« Reply #39 on: June 03, 2004, 02:25:00 PM »

It's not really complex.  Just look up bubble sort on google.  You can use the same method because "IF" has the ability to compare strings, so you don't have to worry about individual characters.

If you want, I can still do it.
Logged

flattspott

  • Archived User
  • Hero Member
  • *
  • Posts: 1220
The Official Filemanager Topic
« Reply #40 on: June 03, 2004, 02:34:00 PM »

Let me go and look it up....
Logged

flattspott

  • Archived User
  • Hero Member
  • *
  • Posts: 1220
The Official Filemanager Topic
« Reply #41 on: June 03, 2004, 02:50:00 PM »

Tried to look it up but got sidetracked with testing your theory. IF does work on comparing strings it seems.

Set One Apple
Set Two Avacado

If %Two% > %One% Then
  MsgBox "%Two% is greater than %One%"
EndIf
Logged

BenJeremy

  • Archived User
  • Hero Member
  • *
  • Posts: 5645
The Official Filemanager Topic
« Reply #42 on: June 03, 2004, 03:03:00 PM »

It should work.... it uses the "C" function "strcmp()" and uses the result: -1, 0, or 1 results from that function.
Logged

flattspott

  • Archived User
  • Hero Member
  • *
  • Posts: 1220
The Official Filemanager Topic
« Reply #43 on: June 03, 2004, 03:48:00 PM »

Well genuisalz it seems like you're gonna have to do this after all. I'm too stupid to figure it out.

Base on a few things I found here's what I tried.

Set SortCount 10
Set Item1 red
Set Item2 orange
Set Item3 blue
Set Item4 yellow
Set Item5 purple
Set Item6 green
Set Item7 black
Set Item8 magenta
Set Item9 saphire
Set Item10 white
For I = %SortCount% To 1 Step -1
  For J = 1 To %I%
     Set J2 %J%
     Add J2 1
     If %Item{J2}% < %Item{J}% Then
        Set Tmp %Item{J}%
        Set Item%J% %Item{J2}%
        Set Item%J2% %Tmp%
     EndIf
  Next
Next
:OutPut
OpenWrite SortFile Z:\Sort.txt
For I = 1 To %SortCount%
  WriteFileLn SortFile %Item{I}%
Next
CloseFile SortFile


It doesn't really work
Logged

koldfuzion

  • Archived User
  • Hero Member
  • *
  • Posts: 1226
The Official Filemanager Topic
« Reply #44 on: June 03, 2004, 03:57:00 PM »

heheh and we are suppose to help him figure out the minesweeper (no mine) problem?  hehhe

i cant even wipe my....nevermind.
Logged
Pages: 1 2 [3] 4 5