ie:
string = 'one,two,three'
MyArray[1] = 'one'
MyArray[2] = 'two'
MyArray[3] = 'three'
I know i can use a loop and the pos function, but is there a shorter method?
Some languages such as PHP support this natively, but PowerBuilder does not.
"Jeff" <nob...@nowhere.com> wrote in message news:45014d47$1@forums-1-dub...
Argument Description
instancename Instance name of n_cst_string
source String to be converted into an array
delimiter String specifying the character(s) that
separate array elements in source
array String array into which the function
places the extracted strings (passed by reference)
/ Separate the statement into multiple statements,
// Separated by UNIONs
li_numstats = lnv_string.of_Parsetoarray (as_sql, "UNION", ls_sql)
If you are using PB9 or higher you can use ImportString to put it into a
datastore and then extract it into an array like this:
DataStore lds_import
String ls_empname[]
lds_import = Create DataStore
lds_import.DataObject = "d_myimportdw"
ls_empname = lds_import.Object.empname.Primary
The datawindow object d_myimportdw would be an external with a single column
called empname and a length large enough to hold the largest possible value.
PB8 and earlier only support tab-delimited for the ImportString function so
you would have to use the Pos loop method.
Roland
"Jeff" <nob...@nowhere.com> wrote in message news:45014d47$1@forums-1-dub...
There is no native PowerScript function to do this.
You will need to roll your own or use this one
http://www.pbdr.com/pbtips/ps/quks2ary.htm
Good luck,
Terry [TeamSybase] and Sequel the techno-kitten
On 8 Sep 2006 05:10:00 -0700,
in sybase.public.powerbuilder.general
*********************************
PowerBuilder for $95? No.
Personal use PowerBuilder Enterprise *AND* PocketBuilder *AND* DataWindow.NET
*AND* Sybase IQ as free benefits of am ISUG membership. See
http://www.isug.com/ISUG3/Membership_benefits.html for details.
*********************************
Click once a day to help the hungry
http://www.thehungersite.com
*********************************
User Manual
===========
TeamSybase <> Sybase employee
Forums = Peer-to-peer
Forums <> Communication with Sybase
IsNull (AnswerTo (Posting)) can return TRUE
Forums.Moderated = TRUE, so behave or be deleted
*********************************
Sequel's Sandbox: http://www.techno-kitten.com
Home of PBL Peeper, a free PowerBuilder Developer's Toolkit.
Version 3.0.02 now available at the Sandbox
PB Futures updated Apr 24/2006
See the PB Troubleshooting & Migration Guides at the Sandbox
^ ^
o o
=*=