Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Help on Array
Message
From
26/08/2013 16:48:19
 
 
To
26/08/2013 16:08:34
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP
Network:
Windows XP
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01581462
Message ID:
01581467
Views:
43
>I am using the following code to get the Maximum two values of posR from a cursor.
>
>
>SELECT TOP 2 posR FROM PageTwo ORDER BY posR DESC INTO ARRAY Maxrows
>nfisrtposR=Maxrows(1)
>nSecondposR=Maxrows(2)
>
>
>However, i a case I am encountered with a situation where there is no posR in Pagetwo and at that situation my program generates error as Maxrows(1).prg does not exist.
>
>Whats the Problem, How to overcome it ?

Check _tally after the Select statement, it will be 0 for no matching records.
Previous
Reply
Map
View

Click here to load this message in the networking platform