Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"entry" question - does entry exist? 1

Status
Not open for further replies.

CoolDudeeh

IS-IT--Management
Oct 21, 2003
21
US
Say I had some code like this that is reading the flat file below

if entry(5,recordin,",") = "e" then
assign entry(5,recordin,",") = "z".

on record 2, I get an error something like "entry 5 is outside the range ..."

Is there a way to test for the existence of an entry or the number of entries in a record?

flat file(3 records)
a,b,c,d,e
a,b,c,d
a,b,c,d,e

I also tried something like this which does not seem to work either.

def var xxtmp as char.
assign xxtmp = entry(5,recordin,",") no-error.
if xxtmp = "" then
assign entry(4,recordin,",") = entry(4,recordin,",") + ",e".
 
From PROGRESS HELP:

Code:
NUM-ENTRIES ( list [ , character ] )
list

A list of strings--an entry list. (See the  ENTRY Function reference entry.) NUM-ENTRIES returns the number of elements in the list. Specifically, NUM-ENTRIES returns the number of delimiters plus 1, and it returns 0 if list equals double quotes ( "").

character

A delimiter you define for the list. The default is a comma (,). This allows functions to operate on non-comma-separated lists. If you use an alphabetic character, this delimiter is case sensitive.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top