I spotted at least 2 errors in your program. One is the locate where you
are locating on the first field but inserting into fields. It should be:
  locate Part in      Part.Array    by 'AL'  setting  posn  else  null
  ins    Part before  Part.Array<posn>
If you want to insert into a field array and
  locate Part in      Part.Array<1>    by 'AL'  setting  posn  else
null
  ins    Part before  Part.Array<1,posn>
if you want to insert into a multi-value array.
The second is the for next loop where you are doing:
 for  Part.Count 
and a 
next This.Part
This.Part is a variable defined as
    This.Part = Part.Array<Part.Count>
This may actually be what is giving you the error.

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Brutzman, Bill
Sent: Thursday, July 27, 2006 11:12 AM
To: 'u2-users@listserver.u2ug.org'
Subject: [U2] [UV] Read Error, Improper Data Type

I am having a problem with a straightforward read statement that is
driving
me crazy...

Suggestions would be appreciated.

--Bill

  __        __
  \_  SLANG _/   Common Names for HK.Parts

_Slang.Name___________


6 record(s) selected to SELECT list #0.
 101312   0
 101485   0
 101859   0
 103468   0
 103469   0
 103543   0

101312?101485?101859?103468?103469?103543

***101312***
Program "SLANG.R0": Line 77, Improper data type.
Variable previously undefined.  Zero length string used.
>

*=======================================================================
====
=======================

*R0  Bill Brutzman   Jul.2006

  prompt ''

  open 'IM'  to  F.Item  else  null

*-----------------------------------------------------------------------
--

  crt @(-1)

  crt 
  crt
  crt
  crt
  crt 
  crt
  crt
  crt '   _________                              '
  crt '  /         \                             '
  crt '  \  SLANG  /   Common Names for HK Parts '
  crt '   \_______/                              ' : @(-5)
  crt
  crt '              ~ 10 sec                    ' : @(-6)
  crt
  crt '                ' :

*-----------------------------------------------------------------------
----
---

  clear

  equate true to 1, false to 0
  equate AM to char(254)

  done = false

  print

  Part.Array = ''

  gosub Print.Header

*-----------------------------------------------------------------------
--

  clearselect ALL

  execute " SELECT IM WITH SLANG.NAME # ''  "

  loop
    readnext Part  else done = true
  until done do
    
    Print.Line  =                        ' '
    Print.Line := Part          'L#6'  : '   '
    Print.Line := Slang.Name

    crt Print.Line

  locate Part in      Part.Array<1>    by 'AL'  setting  posn  else
null
  ins    Part before  Part.Array<posn>

  Next.Step:
  repeat

  crt
  crt Part.Array
  crt

  All.Parts = dcount(Part.Array, AM)

  for Part.Count = 1 to All.Parts

    This.Part = Part.Array<Part.Count>

    crt '***' : This.Part : '***'

    read  R.Item  from F.Item, This.Part   else  R.Item = ''
      Slang.Name = R.Item<11>

    if Slang.Name = '' then go Next.Step

  next This.Part


*-----------------------------------------------------------------------
----
---
Exit.Prompt:  

  crt @(0,22) : @(-4) : '  [X] ' : 

  input Ans, 1

  Ans = upcase(Ans)

  begin case
        case Ans = 'X'  ;  go The.End
        case 1          ;  go Exit.Prompt
  end   case

  go The.End:

*-----------------------------------------------------------------------
--
Print.Header:

  crt @(-1)

  crt '  __        __                             '
  crt '  \_  SLANG _/   Common Names for HK.Parts  '
  crt

  Print.Line  = ' _HK.PN____'
  Print.Line  = '_Slang.Name___________'

  print Print.Line
  print

return

*-----------------------------------------------------------------------
--
The.End:

  crt @(-1)

  END
-------
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
-------
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to