제목 자체는 꽤 자명합니다. PHP의 "폭발"기능과 동일한 기능이 powerbuilder에 있습니까? 대한PHP의 "폭발"기능과 동일한 powerbuilder 함수가 있습니까?
PHP의 다음 링크를 참조, "폭발"PHP explode
제목 자체는 꽤 자명합니다. PHP의 "폭발"기능과 동일한 기능이 powerbuilder에 있습니까? 대한PHP의 "폭발"기능과 동일한 powerbuilder 함수가 있습니까?
PHP의 다음 링크를 참조, "폭발"PHP explode
하지 내장하지만, PFC 문자열 서비스 제한을 제외하고, PHP의 explode()
과 같은 일을 of_parse_to_array()
있습니다. PFC를 사용하지 않는 경우 of_parse_to_array()
(물론 저작권 공지를 유지)을 들거나 pfc_n_base, n_base, pfc_n_cst_string 및 n_cst_string을 가져 와서 전체 문자열 서비스를 사용할 수 있습니다. 한계 인이 필요한 경우 을 구현하는 오버로드 된 버전 of_parse_to_array()
을 쉽게 추가 할 수 있습니다.
_limit_는 문자열이 많은 토큰을 구문 분석 할 것으로 예상했지만 처음 _n_에만 관심이있는 경우 유용합니다. –
Powerbuilder는 데이터베이스 집약적 인 응용 프로그램에 거의 독점적으로 사용되고 있으므로 데이터베이스 시스템을 사용하는 것이 더 편리 할 수 있습니다.
외부에서 사이베이스 SQL을 사용하는 경우, 파워 빌더와 함께 제공, 당신은 sa_split_list
system procedure
를 사용할 수 있습니다 또는 당신이 당신의 자신을 구축 할 수있는 런타임. PFC의이 기능은 사용할 수 포함
//////////////////////////////////////////////////////////////////////////////
//
// Function: of_ParseToArray
//
// Access: public
//
// Arguments:
// as_Source The string to parse.
// as_Delimiter The delimeter string.
// as_Array[] The array to be filled with the parsed strings, passed by reference.
//
// Returns: long
// The number of elements in the array.
// If as_Source or as_Delimeter is NULL, function returns NULL.
//
// Description: Parse a string into array elements using a delimeter string.
//
//////////////////////////////////////////////////////////////////////////////
//
// Revision History
//
// Version
// 5.0 Initial version
// 5.0.02 Fixed problem when delimiter is last character of string.
// Ref array and return code gave incorrect results.
//
//////////////////////////////////////////////////////////////////////////////
//
/*
* Open Source PowerBuilder Foundation Class Libraries
*
* Copyright (c) 2004-2005, All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted in accordance with the GNU Lesser General
* Public License Version 2.1, February 1999
*
* http://www.gnu.org/copyleft/lesser.html
*
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals and was originally based on software copyright (c)
* 1996-2004 Sybase, Inc. http://www.sybase.com. For more
* information on the Open Source PowerBuilder Foundation Class
* Libraries see http://pfc.codexchange.sybase.com
*/
//
//////////////////////////////////////////////////////////////////////////////
long ll_DelLen, ll_Pos, ll_Count, ll_Start, ll_Length
string ls_holder
//Check for NULL
IF IsNull(as_source) or IsNull(as_delimiter) Then
long ll_null
SetNull(ll_null)
Return ll_null
End If
//Check for at leat one entry
If Trim (as_source) = '' Then
Return 0
End If
//Get the length of the delimeter
ll_DelLen = Len(as_Delimiter)
ll_Pos = Pos(Upper(as_source), Upper(as_Delimiter))
//Only one entry was found
if ll_Pos = 0 then
as_Array[1] = as_source
return 1
end if
//More than one entry was found - loop to get all of them
ll_Count = 0
ll_Start = 1
Do While ll_Pos > 0
//Set current entry
ll_Length = ll_Pos - ll_Start
ls_holder = Mid (as_source, ll_start, ll_length)
// Update array and counter
ll_Count ++
as_Array[ll_Count] = ls_holder
//Set the new starting position
ll_Start = ll_Pos + ll_DelLen
ll_Pos = Pos(Upper(as_source), Upper(as_Delimiter), ll_Start)
Loop
//Set last entry
ls_holder = Mid (as_source, ll_start, Len (as_source))
// Update array and counter if necessary
if Len (ls_holder) > 0 then
ll_count++
as_Array[ll_Count] = ls_holder
end if
//Return the number of entries found
Return ll_Count
[비슷한 질문] (http://groups.google.com/group/sybase.public.powerbuilder.powerscript/browse_thread/thread/379c3c2af8bd968f/0b2bde1bea45ee96?lnk=raot&pli = 1) on sybase.public.powerbuilder.powerscript – Sjoerd