Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Tom Rettigs Library - nextarea() http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 NEXTAREA()
 Obtains the next available work area.
 Returns <expN> lowest available work area, or zero if none available.

 Return value must be converted to a string and stored in a memvar
 before being used in a SELECT command.

 m_workarea = LTRIM(STR(NEXTAREA()))
 IF VAL(m_workarea) > 0
    SELECT &m_workarea
    USE File ALIAS Name    && remember to close
 ELSE
    ? "Error -- all work areas have open files."
 ENDIF

 Hazard
    Be careful when mixing relative work area references such as
    SELECT() or NEXTAREA() and absolute references such as SELECT 2.
    Using an absolute reference can inadvertently close a file that
    was opened using a relative reference.


             Placed in the Public Domain by Tom Rettig Assoc.

See Also: GETAREA()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson