+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Super Member
    Using
    not specified
    Join Date
    Feb 2006
    Posts
    527

    Default Determining if I have string characters in text a variable

    Registered forum members do not see this ad.

    Finding text in Array2(jx) <> ""?
    My program looks at the statement Array2(jx) <> ""to see if there is
    any text in Array2(jx). If Array2(jx) does not equal "" there should
    be text in Array2(jx). I don't think this works in a batch loop so is there
    another way to check to see if I have text in Array2(jx) ?
    thank you,

  2. #2
    Super Member ASMI's Avatar
    Using
    AutoCAD 2008
    Join Date
    Nov 2005
    Location
    Oceanus Procellarum, Moon
    Posts
    1,427

    Default

    Registered forum members do not see this ad.

    In VBA it is impossible to check up conformity of elements of an array to the certain condition without using loop. You should write about such function (very simplified example, without checks) and to use it in your programs:

    Code:
    Public Function IsNonEmptyStringsInArray(Arr() As String) As Boolean
    Dim Out As Boolean
    Out = False
        For i = LBound(Arr) To UBound(Arr)
            If Arr(i) <> "" Then
                Out = True
            End If
        Next i
    IsNonEmptyStringsInArray = Out
    End Function
    In LISP it is possible for lists:

    Code:
    (defun IsNonEmptyStringsInList(StrLst / Out)
      (mapcar '(lambda(x)(if(/= x "")(setq Out T)))StrLst)
      Out)
    Testing:
    Code:
    _$ (IsNonEmptyStringsInList '("" "" "" ""))
    nil
    _$ (IsNonEmptyStringsInList '("" "" "Yes!" ""))
    T

Similar Threads

  1. text string issue
    By jpcedotal in forum AutoCAD Drawing Management & Output
    Replies: 8
    Last Post: 29th Nov 2006, 08:58 pm
  2. string text
    By brassworks in forum AutoCAD Drawing Management & Output
    Replies: 2
    Last Post: 6th Oct 2006, 03:04 pm
  3. Adding a String to the Text Command
    By muppetfan88 in forum AutoLISP, Visual LISP & DCL
    Replies: 1
    Last Post: 29th Apr 2006, 03:49 am
  4. Creating Special Text Characters
    By W K Martin in forum AutoCAD Drawing Management & Output
    Replies: 1
    Last Post: 23rd Jan 2006, 07:19 pm
  5. Insert Text String
    By Bass'nBoots in forum AutoLISP, Visual LISP & DCL
    Replies: 3
    Last Post: 21st Oct 2005, 06:32 pm

Bookmarks

Posting Permissions

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