Jump to content


Photo

Del *.*, Rmdir, Arrays And


  • Please log in to reply
4 replies to this topic

#1 SumDumGuy2

SumDumGuy2

    X-S Enthusiast

  • Members
  • 21 posts

Posted 16 December 2003 - 10:46 PM

Hi All,

I have to tell you. I am pretty excited about ActionScripting. I have been away from the Scene for a long time... about a year. And some serious scripting capability was very high on my wish list when I faded into all work and no play about a year ago... Now I come back and find that Action Scripting is has taken charge and is barrelling down the road like a semi with no brakes... and not only that but it comes in the absolute best looking/most versatile menu system my xbox has ever seen... Wow is that some good stuff...

ok, enough telling you all what you already know (like MXM Rocks!!!), I have a question or two...

First of all, I know I have read this somewhere but I have read so much in the last day and a half that I cant remember half of what I read or where it was. So, does "Del" support wildcards? If not does the "Rmdir" remove only empty folders or will it delete a folder and all of its contents?

Ok, my next question is that, unless I was overlooking it, it did not seem as though ActionScripting supports arrays... I know, I am pushing it aren't I? hehe, but I remember reading somewhere someone was asking about using something like VARNAME%COUNT% for a variable %VARNAME1%, %VARNAME2% and so on. As soon as I saw that I thought "That is not what you need... what you need is an array, %VARNAME%(%Count%)". And arrays are soooo useful... I know, soon I will be asking BJ to implement a full Visual Basic for XBOX... heheh, But seriously, if this is not in there already maybe in a future version? wink.gif wink.gif wink.gif

Another quick question, is the best way to loop through files in a folder to use the BeginSearch Path* and SearchNext functions or is there a better way? If that is the best way how do you tell when you get to the end of the list of files? When SearchItem comes up empty?

Finally, I have never really used XML and I was tempted to do something with an INI file, but I assume from what I have read and from the really good XML support that MXM seems to have, that using XML would be a much better way to go than an INI to store information in files and parse with a ActionScript. Is that correct? or is it 6 of one, half dozen of the other (just a matter of preference) type thing?

I have some ideas but I will save them for another thread...

Thanks in advance,
SDG

Edit: Sorry, just thought of one more for this thread. I have not seen much on where ActionScripts can be launched from... Can you have a regular menu item that looks just like it is a xbe file, with an icon or animation and everything but is actually a script or do they have to be called from somewhere specfici?

Thanks again...

Edited by SumDumGuy2, 16 December 2003 - 10:50 PM.


#2 geniusalz

geniusalz

    Team MXM

  • Head Moderators
  • PipPipPipPipPip
  • 1,827 posts
  • Gender:Male
  • Xbox Version:v1.1
  • 360 version:unknown

Posted 16 December 2003 - 11:03 PM

No native support for arrays.
But you can use an xml object to work like an array. I won't detail the whole thing here, and its been discussed before.

This is what I used to find the end of search:
CODE

SEARCHTYPE s_type
IF %s_type% == "dir" GOTO DIRFOUND
IF %s_type% == "file" GOTO SKIPFILE
QUIT


XML is better than INI in terms of structure.
More organized, you can say. And u can make a hierarchy in it. eg submenus inside submenus inside menus, without using braces and the like.

Scripts in menus are just like normal items

<Item>
<Media>C:\blah.wmv</Media>
<Thumbnail>C:\blah.jpg</Thumbnail>
and instead of a <Exe>C:\blah.jpg</Exe>, you have
<Action>Callscript C:\blah.xas</Action>
</Item>

Right now there's no drop-in functionality for actionscripts, but there's gonna be some soon.

Edited by geniusalz, 16 December 2003 - 11:04 PM.


#3 SumDumGuy2

SumDumGuy2

    X-S Enthusiast

  • Members
  • 21 posts

Posted 16 December 2003 - 11:15 PM

QUOTE
you can use an xml object to work like an array


Excellent... Thanks, I will do a search on that.

QUOTE
This is what I used to find the end of search:...


I am not sure I follow you on your example, but I will throw some small test scripts on the xbox a little later to see if I can get ahold of it...

QUOTE
XML is better than INI in terms of structure.
More organized

QUOTE
submenus inside submenus inside menus


Now that you mention it I can see that being easier... Thanks for pointing it out...

QUOTE
Scripts in menus are just like normal items


Excellent!!! That is perfect...

Thanks again for your help and your quick response...
Regards,
SDG


#4 geniusalz

geniusalz

    Team MXM

  • Head Moderators
  • PipPipPipPipPip
  • 1,827 posts
  • Gender:Male
  • Xbox Version:v1.1
  • 360 version:unknown

Posted 16 December 2003 - 11:19 PM

CODE
SEARCHTYPE s_type
IF %s_type% == "dir" GOTO DIRFOUND
IF %s_type% == "file" GOTO FIILEFOUND
QUIT


This just tells it to check the search result type..
If it's a file, goes to whereever you tell it to.
And if it's a directory, goes wherever you tell it to.
But if it's neither, it means you are at the end of the search, so it quits. Again, you can do anything there, if you don't want to quit.

#5 SumDumGuy2

SumDumGuy2

    X-S Enthusiast

  • Members
  • 21 posts

Posted 16 December 2003 - 11:31 PM

Ok, Duh... makes perfect sense now... Thanks again...




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users