gettingstarted
[Top] [All Lists]

Re: InStr problems

To: Getting Started <gettingstarted at lists dot realsoftware dot com>
Subject: Re: InStr problems
From: Russ Jones <russ dot jones at computer dot org>
Date: Fri, 28 May 2004 21:09:37 -0400
Delivered-to: gettingstarted at lists dot realsoftware dot com
List-help: <mailto:gettingstarted-request@lists.realsoftware.com?subject=help>
List-id: Getting Started <gettingstarted.lists.realsoftware.com>
List-post: <mailto:gettingstarted@lists.realsoftware.com>
References: <20040528170006 dot F3A0F1F04E3 at lists dot realsoftware dot com> <F927B8AB-B105-11D8-87EA-000393DBA370 at copper dot net>
Interesting...

I just tried a copy of your code, with minor modifications as below, and it works ok as the content of a pushbutton. First time around, pp = 4, e = 1. Next pp=0, e = 1. Then it is done.

RB 5.5.2, Mac OS 10.3.4

Russ

======================

  Dim Astr As String
  Dim pp As Integer
  dim e as integer

  Astr="(÷÷)"

  pp=-1
  Do
    pp=pp+2
    e = e +1
    pp=InStr(pp,Astr,")")
    msgbox str(pp) + "   " + str(e)
  Loop Until pp=0 or e > 10
=============================


On May 28, 2004, at 8:20 PM, Aubrey Todd wrote:

Sorry Joe, you are correct, it would go to '0' for you. There was another change being made that I overlooked. I created a new program with a single button to run this code:

pbProceed.Action
  Dim Astr As String
  Dim pp As Integer

  Astr="(÷÷)"
//Put a break here and step through the Debugger and watch the value of pp
  //Check for ')' in Astr
  pp=-1
  Do
    pp=pp+2
    pp=InStr(pp,Astr,")")
  Loop Until pp=0

End Sub

This is the only code, except for Quit, in the program. It goes into an endless loop for me every-time I run it. You don't need the '(' and it appears the ')' can be any character, I have tried a 5 and a space, just change the line pp=InStr(pp,Astr,"x") so that 'x' is the last character in Astr. It seems the only thing that is important is having '÷÷' in there someplace and they do not need to be together.

Aubrey

_______________________________________________
Unsubscribe or switch delivery mode:
<http://support.realsoftware.com/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>


_______________________________________________
Unsubscribe or switch delivery mode:
<http://support.realsoftware.com/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

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