November 27, 2001 

===============================================================
>From the Edge: New (ITEMCNT('TextString')) Function
Chapter:                Functions (Data Manipulation)
Section:                Running R:BASE Your Way!
Platform:               R:BASE 2000 (ver 6.5++) for DOS/Windows
Build:                  1.845xRT03 and Higher ...
===============================================================

Among many enhancements, new commands, features and the 
bug-fixes, a new ITEMCNT function has been added to the 
group of "Data Manipulation Functions" of R:BASE 2000 
(version 6.5++), Build:1.845xRT03 and higher. 

New ITEMCNT function could be used to count the number 
of items in a text string separated by current comma 
delimiter.

Syntax: (ITEMCNT('TextString'))

Example 01:

SET VAR vItems = (ITEMCNT('a,b,c'))

will return 3.

Example 02:

SET VAR vModels TEXT = NULL
SET VAR vLines INTEGER = NULL
SET VAR vModel TEXT = NULL
SELECT (LISTOF(Model)) INTO vModels INDIC IModel FROM Product
SET VAR vLines = (ITEMCNT(.vModels))
IF vLines > 18 THEN
   SET LINES = 18
ENDIF
CLS
CHOOSE vModel FROM #LIST .vModels AT 4 30 TITLE 'Choose Model' +
CAPTION 'Available Models' Lines .vLines FORMATTED
IF vModel IS NULL OR vModel = '[Esc]' THEN
   GOTO Done
ENDIF

-- Do what you have to do here ...

LABEL Done
CLEAR ALL VAR or whatever accordingly 
QUIT TO MainMenu.RMD
RETURN

Download the PDF version of this article at: 

http://www.razzak.com/fte

Very Best Regards,

Razzak.

===================================-============================
Official R:BASE List Server:    mailto:[EMAIL PROTECTED]
RBTI Events/Training:        http://www.rbase2000.com/events
R:DCC Members:               http://www.rbase2000.com/rdcc
================================================================
R:BASE, Oterro & R:Tango are registered trademarks of RBTI.
==================================-=============================

Reply via email to