realbasic-nug
[Top] [All Lists]

Re: Suggestions for files

To: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Subject: Re: Suggestions for files
From: Arnaud Nicolet <anic297@mac.com>
Date: Fri, 28 Nov 2008 22:26:47 +0100
Authentication-results: mx.google.com; spf=neutral (google.com: 74.124.194.228 is neither permitted nor denied by best guess record for domain of realbasic-nug-bounces@lists.realsoftware.com) smtp.mail=realbasic-nug-bounces@lists.realsoftware.com
Delivered-to: listarchive@realsoftware.com
In-reply-to: <49300E11.8090302@stny.rr.com>
References: <49300E11.8090302@stny.rr.com>
Reply-to: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Sender: realbasic-nug-bounces@lists.realsoftware.com
Le 28 nov. 08 à 16:28 (soir), Tom Russell a écrit:

I am looking for some suggestions on the best way to tackle the following.

I have a folder with different files in it. I am looking only for files that look like this:

grp1.xml
grp2.xml
grp3.xml

The first 3 letters will always be the same but the number following it will be unknown to me.

What would be the best way to get a list of only these types of files?

I don't know whether it's the best way, but this is one:

  dim f As FolderItem
  dim g As FolderItem
  dim h() As FolderItem
  dim i As Integer
  dim s As String
  dim t As String

  for i=1 to f.Count
    g=f.TrueItem(i)
    s=g.Name
    if Left(s,3)="grp" and Right(s,4)=".xml" then
      t=mid(s,4,len(s)-7)
      if str(val(t))=t then
        h.Append g
      end if
    end if
  Next
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>


<Prev in Thread] Current Thread [Next in Thread>