xboxscene.org forums

Pages: 1 2 3 [4] 5

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

geniusalz

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

CODE

Set SortCount 10
Set Item1 yellow
Set Item2 orange
Set Item3 red
Set Item4 blue
Set Item5 purple
Set Item6 green
Set Item7 white
Set Item8 magenta
Set Item9 saphire
Set Item10 black
Set newCount %SortCount%
Sub newCount 1

For I = %newCount% To 1 Step -1
   If# %I% > 1 Then
 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
   Else
 Set J 1
 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
   EndIf
Next


:OutPut

Set outp "Sorted:"

For L = 1 To %SortCount%
   Set outp %outp%$eol$%Item{L}%
Next

Msgbox %outp%
Logged

BenJeremy

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

Well, looking at the code, it should equal 9 on the first pass.

As for the 1 to 1 issue.... I think I've got a fix for it, and it should be in the next version. Basically, what screwed thatup was my check to insure the "Step" parameter wasn't done incorrectly.
Logged

BenJeremy

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

CODE

SET SomeVal1 10
SET SomeCount %SomeVal1%
SUB SomeCount 1
FOR I = %SomeCount% to 1 step -1
MsgBox "Loop Counter I=%I%"
NEXT

FOR I = 1 to 1
MsgBox "Single Loop (1 to 1) I=%I%"
NEXT


and I got the expected results for the first loop, without any changes to the code - msgbox showed values 9 to 1.

The small fix I did for the "single loop" worked. As I said before, it was just a matter of including the "==" condition when verifying the correctness of the parameters of start, end and step.

You can actually leave off the step -1, too.... it assumes a delta of 1 or -1, depending on the start and end values.
Logged

Yuyu

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

CODE
'array = array to be sorted
'number of elements = number of elements in array
'elements switched = flag if elements switched during pass
'temp = temp holding place for element being switched
'I = index for outer loop
'J = index for inner loop

Bubble sort alogorithm
   set I to number of elements
   set elements switched to true
   DOWHILE (elements switched AND I >= 2)
 set J to 1
 set elements switched to false
 DOWHILE J =< I-1
    IF Array(J) > Array(J+1) THEN
   temp = Array(J)
   Array(J) = Array(J+1)
   Array(J+1) = temp
   elements switched = true
    ENDIF
    J = J+1
 ENDDO
 I = I-1
   ENDDO
END





Logged

flattspott

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

smile.gif
Logged

geniusalz

  • Archived User
  • Hero Member
  • *
  • Posts: 1635
The Official Filemanager Topic
« Reply #50 on: June 04, 2004, 12:41:00 AM »

QUOTE (BenJeremy @ Jun 3 2004, 10:14 PM)
and I got the expected results for the first loop, without any changes to the code - msgbox showed values 9 to 1.

The small fix I did for the "single loop" worked. As I said before, it was just a matter of including the "==" condition when verifying the correctness of the parameters of start, end and step.

Yeah, flattspott's code went from 10 to 1, which was a logical bug rather than a problem in mxm.

QUOTE
You can actually leave off the step -1, too.... it assumes a delta of 1 or -1, depending on the start and end values.

Yeah, I noticed that.
Logged

flattspott

  • Archived User
  • Hero Member
  • *
  • Posts: 1220
The Official Filemanager Topic
« Reply #51 on: June 11, 2004, 09:08:00 AM »

huh.gif

On the brightside, I have it so you can copy, delete, rename, backup, move, attr ro and attr rw single or multiple files. Also you can makedirs, launch xbe's, patch xbes and view images.

Edit. forgot about playsounds too.
Logged

flattspott

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

Updateroo:

user posted image

A little built in Keyboard that won't allow you to rename anything that isn't FATX safe.
Logged

koldfuzion

  • Archived User
  • Hero Member
  • *
  • Posts: 1226
The Official Filemanager Topic
« Reply #53 on: June 19, 2004, 06:43:00 PM »

smile.gif  nice to see progress is still being made.

Logged

flattspott

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

yeah, slowly but steadily.

Perhaps someome would be interested in doing a routine to rename XBE titles with the Buffers and whatnot?
Logged

koldfuzion

  • Archived User
  • Hero Member
  • *
  • Posts: 1226
The Official Filemanager Topic
« Reply #55 on: June 20, 2004, 01:58:00 AM »

QUOTE
Perhaps someome would be interested in doing a routine to rename XBE titles with the Buffers and whatnot?


i worry about that.  it appears that people who are using xbe renamers are losing the original hexid for the game.

This is preventing some UnleashX users (and maybe soon, MXM users) from downloading the videos from the GamesDB..as the HexID is required to be valid.
Logged

geniusalz

  • Archived User
  • Hero Member
  • *
  • Posts: 1635
The Official Filemanager Topic
« Reply #56 on: June 20, 2004, 04:32:00 AM »

QUOTE (flattspott @ Jun 19 2004, 10:01 PM)
Updateroo:

user posted image

A little built in Keyboard that won't allow you to rename anything that isn't FATX safe.

All I can ask is... Why make a keyboard?

But now that you have made one already, I think it will be better if the Upper case letters, lower case letters and numbers were organized into little 'blocks'
Something like this:

CODE

ABCDEFG abcdefg 123
HIJKLMN hijklmn 456
OPQRST. opqrst; 789
UVWXYZ  uvwxyz, 0:'



Edit: Is the keyboard skinnable (1 big pic)?
Logged

flattspott

  • Archived User
  • Hero Member
  • *
  • Posts: 1220
The Official Filemanager Topic
« Reply #57 on: June 20, 2004, 07:14:00 AM »

QUOTE
All I can ask is... Why make a keyboard?

like i said...won't allow you to rename anything that isn't FATX safe.

And yes I suppose it could be skinable. The way it works now is like so

1. BOX - the is a box that is as big as the keyboard but under the overlay. This is the color of the unselected keys
2. BOX - This is a little box the gets moved arround to give the impression of selecting a key
3. an overlay of the keyboard - this is an image with the keys cutout so the two boxes show up underneath



I see about changing the key layout though.
Logged

BenJeremy

  • Archived User
  • Hero Member
  • *
  • Posts: 5645
The Official Filemanager Topic
« Reply #58 on: June 20, 2004, 07:27:00 AM »

What I need to do is make the keyboard and key input more flexible for the scripters.

Now that PnP is shaping up, I will be working on that.
Logged

geniusalz

  • Archived User
  • Hero Member
  • *
  • Posts: 1635
The Official Filemanager Topic
« Reply #59 on: June 20, 2004, 01:05:00 PM »

QUOTE (flattspott @ Jun 20 2004, 07:14 PM)
like i said...won't allow you to rename anything that isn't FATX safe.

And yes I suppose it could be skinable. The way it works now is like so

1. BOX - the is a box that is as big as the keyboard but under the overlay. This is the color of the unselected keys
2. BOX - This is a little box the gets moved arround to give the impression of selecting a key
3. an overlay of the keyboard - this is an image with the keys cutout so the two boxes show up underneath



I see about changing the key layout though.

Yeah, but a simple few IF's can take care of that; definitely easier than making a whole keyboard.  Well, if you wanna do it, that's upto you.

BTW, quite a smart idea on how the overlay and boxes work for the keyboard.
Logged
Pages: 1 2 3 [4] 5