Форум » [x]Harbour » Ains » Ответить

Ains

Dima: Я глючу или Harbour или доку не ту смотрел ? [pre2] a:={"1","2","4"} a:=ains(a,3,"3") ? len(a) // должно быть 4 for i=1 to len(a) ? a // 1 2 NIL next // должно быть 1 2 3 4 [/pre2]

Ответов - 7

PSP: Ты глючишь. ))) Размер не меняется. Если надо расширить, то сначала ASize() http://www.itk.ru/clip-doc.ru/categarray.html#FUNCTIONAINS

Dima: PSP пишет: Ты глючишь. ))) Нет ;) Доку не ту смотрел [pre2] AIns() Inserts an element into an array. Syntax AIns( <aArray>, <nElement>, [<xValue>], [<lGrow>] ) --> aArray Arguments <aArray> A variable holding the array to insert an element into. <nElement> This is a numeric expression indicating the ordinal position where to insert the new array element. It must be in the range between 1 and Len(<aArray>). <xValue> A value of arbitrary data type to assign to the new array element. It defaults to NIL. <lGrow> Optionally, a logical value can be specified. If .T. (true) is passed, the length of the array is enlarged by one element. The default value is .F. (false) leaving the number of elements in <aArray> unchanged. [/pre2]

PSP: Ну, тогда lGrow д.б. .T., наверное... ) Это ж расширение. В стандартной AIns() этого параметра нет


Dima: Мне б такой Ains как в Xharbour Builder ;) Нет готового решения ? Вроде Павел что то делал...

Dima: PSP пишет: Ну, тогда lGrow д.б. .T., наверное... ) Ставил и до лампочки и по ходу понимает только 2 параметра

PSP: По-моему, существует HB_AIns(). Посмотри Changelog

Dima: PSP Точно. Оно. Спасибо !



полная версия страницы