gettingstarted
[Top] [All Lists]

EditField not showing proper text

To: Getting Started <gettingstarted at lists dot realsoftware dot com>
Subject: EditField not showing proper text
From: Wayne Dreier <wwdmld at earthlink dot net>
Date: Sun, 16 Nov 2003 00:08:52 -0500
Here is my code in the Open sub routine for EditField()

  Dim S As String
  Dim N As Integer
  Dim F As FolderItem
  Dim Stream As TextInputStream
F = GetFolderItem("Last Source Number") // File in which I store my last number in format @SRCH###@
  If F <> Nil Then
    Stream = F.OpenAsTextFile
EditField1(0).Text = Stream.ReadAll() // This reads the line in the file and puts it in the EditField
    Stream.Close
  End If
  S = Mid(me.Text, 6)
  N = Val(S)
  N = N + 1
EditField1(0).Text = "@SRCH" + Str(N) + "@" //This line replaces the string read from the file with the new number.
  EditField1(1).SetFocus

The sub routine ends.

What happens is the code runs through each line and by watching the variable window in the debugger I can see the changes take place as they should.

However, when the code gets to the end, it starts over at F = statement but with all the values either set to zero or empty.

This routine worked fine until I converted my EditFields into an array. What causes the routine to run twice? What can I do about it?

Wayne


- - -
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>