Hi Irv,

this is a shorter version that I use but I dont know how good it is but it works:

gSoundList = []
  repeat with i = 1 to 255
    filename = getNthFileNameinFolder(gSoundFolder, i)
    if filename = "" then exit repeat
    add gSoundList, filename
  end repeat

  strip = ""
  repeat with i = 1 to gSoundList.count
    strippo = gSoundList[i].char[1..gSoundList[i].length-4]
    put strippo & RETURN after strip
  end repeat
  member("cdTrack").text = strip
  delete the last char of member("cdTrack")

Tony

m�ndagen den 18 augusti 2003 kl 19.02 skrev Irv Kalb:

It sounds like you do have some confusion between a list and a textual representation of that list. If you need to build up these items into a list (maybe for saving and using elsewhere), you can do it like this (untested e-mail Lingo):

fileList = []
repeat with i = 1 to the maxInteger
  thisFileName = getNthFileNameInfolder(<your target folder>, i)
  if thisFileName = EMPTY then
    exit repeat
    add(fileList, thisFileName)
  end if
end repeat

Then to display the list in a text or field member

listAsString = ''
nItems = count(fileList)
repeat with i = 1 to nItems
  thisFileName = fileList[i]
  put (thisFileName & return) after listAsString
end repeat
delete the last char of listAsString  -- eliminate final extra RETURN
member("<your display member>").text = listAsString


Then you still have the list in the variable fileList.


However, if you just want to display the list of files, you can eliminate the list entirely like this (again untested e-mail Lingo):

listAsString = ""
repeat with i = 1 to the maxInteger
  thisFileName = getNthFileNameInFolder(<your target folder>, i)
  put (thisFileName & return) after listAsString
end repeat
delete the last char of listAsString
member("<your text member>").text = listAsString

Irv

At 2:50 PM +0200 8/18/03, Tony �str�m wrote:
Hi List,

I getNthFileNameinFolder into a gSoundList an put RETURN after every filename then
on mouseUp
nLine = the mouseLine
if nLine > 0 then
sprite(me.spriteNum).member.line[nLine].hilite()gSoundList[nLine]
end if
end


When I click below the last filename in the scrollable field I get the error "Index out of range!" I can understand that.
How can I delete the RETURN after the last filename in the gSoundList?


TIA
Tony

[To remove yourself from this list, or to change to digest mode, go to http://www.penworks.com/lingo-l.cgi To post messages to the list, email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping with programming Lingo. Thanks!]


--

Multimedia Wrangler.
[To remove yourself from this list, or to change to digest mode, go to http://www.penworks.com/lingo-l.cgi To post messages to the list, email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping with programming Lingo. Thanks!]



[To remove yourself from this list, or to change to digest mode, go to http://www.penworks.com/lingo-l.cgi To post messages to the list, email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping with programming Lingo. Thanks!]

Reply via email to