help with 'repeat'- if I need to(?)

Ask a Question related to Macromedia Director Lingo, Design and Development.

  1. #1

    Default help with 'repeat'- if I need to(?)

    Hi,
    I am using buddy api to get a list of pc drives: set dl = baDiskList(), then I want to see which of the drives is a cd-rom.
    If I look at the dl list and pick one to check via: set dt = baDiskInfo("g","type"), I get a good result.
    My trouble is in trying to automate the process- ie, get a line of code to take the dl list items and check them, by which I get a new list. I have tried: irepeat with q = 1 to dl.count, set dt = baDiskInfo(q, "type"), but it only gives me one result. I have tried to fit an append in there, but to no avail.
    Help, please.


    BigDaddy webforumsuser@macromedia.com Guest

  2. Similar Questions and Discussions

    1. repeat
      I used to play certain games on Shockwave but now when I want to play them it says that I need a media player or a shockwave player. I click to...
    2. help me with repeat while
      Hi! Shouldn't this work; repeat while J < 4 t = member("w3d").newTexture("B",#fromCastMember,member("B")) end repeat
    3. background-repeat: repeat-x in HTML? Please help!
      I want to have a "centered page" look full screen...I have made them using layers and CSS but if I need it to work in most browsers how do I do the...
    4. Repeat Header??
      Hi, Can I repeat the datagrid header every X rows??? Regards Eval
    5. repeat while...
      I'm having difficulty with a repeat loop in some movie controls. When I press the rewind button and the movieTime reaches 0, it goes back to the...
  3. #2

    Default Re: help with 'repeat'- if I need to(?)

    how bout:

    cdromdirves = []
    repeat with i in baDiskList
    if baDiskInfo(i,"type") then
    cdromdirves.append(i)
    end if
    end repeat

    "BigDaddy" <webforumsuser@macromedia.com> wrote in message
    news:bepcf1$od4$1@forums.macromedia.com...
    > Hi,
    > I am using buddy api to get a list of pc drives: set dl = baDiskList(),
    then I want to see which of the drives is a cd-rom.
    > If I look at the dl list and pick one to check via: set dt =
    baDiskInfo("g","type"), I get a good result.
    > My trouble is in trying to automate the process- ie, get a line of code to
    take the dl list items and check them, by which I get a new list. I have
    tried: irepeat with q = 1 to dl.count, set dt = baDiskInfo(q, "type"), but
    it only gives me one result. I have tried to fit an append in there, but to
    no avail.
    > Help, please.
    >
    >

    Alexander Ross Guest

  4. #3

    Default Re: help with 'repeat'- if I need to(?)

    HI, I don't know anything about Buddy API, but I do know you can perform this operation with the free Xtra, FileXtra3 (go to the 3rd party xtras page)

    then use this code:

    c=1
    fxObj=xtra("FleXtra3").new()

    myvolumelist=fxObj.fx_VolumesToList()

    repeat with i=1 to myvolumelist.count
    if fxObj.fx_VolumeIsCDROM(myvolumelist) then
    mycdromlist[c]=myvolumelist
    c=c+1
    end if
    end repeat

    This will put all your cdroms in one list.




    tgilmour webforumsuser@macromedia.com Guest

  5. #4

    Default Re: help with 'repeat'- if I need to(?)

    Thanks for the reply!
    I don't know much about fileXtra. I was hoping to get it done via buddy api- I bought it.
    I have a hard coded 'solution', but it isn't driven by 'how many' drives are found.
    If there's anyone else who could take a shot at my dilemma, please do.
    Thanks,
    Big Daddy


    BigDaddy webforumsuser@macromedia.com Guest

  6. #5

    Default Re: help with 'repeat'- if I need to(?)

    Do you want to return just the first CD drive found, or a list of all cd drives (many computers have an external burner & internal reader)

    It looks like you're heading in the right direction with your Buddy code and repeat loop, can you post the complete handler you are using because it seems that you probably just have a simple error in your repeat loop.

    This (untested) code should return the first CD-ROM drive
    on findCDdrive
    dl = baDiskList()
    repeat with d in dl
    if baDiskInfo(q, "type") = "CD-ROM" then RETURN d
    end repeat
    end

    just put that in a movie script & type in the message window

    put findCDdrive()

    Also - if you're project is running from the CD drive then you will be able to get the name of the drive from 'the moviePath' property

    hth

    johnAq


    johnAq webforumsuser@macromedia.com Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139