collection.Insert(...) crash

Post

Posted
Rating:
#1 (In Topic #1398)
Regular
chrisRoald is in the usergroup ‘Regular’
Hi All,
    I'm looking at online documentation for the collection.insert(…) method: /comp/gb/collection/insert - Gambas Documentation
My code with a .insert(…) statement is crashing (see screenshot) - the collection $collectRecursive is a property of the class,
defined thus:     

Code (gambas)

  1. Property collectRecursive As Collection Use $collectRecursive

Image

(Click to enlarge)


I checked if a locally defined collection would work, instead of property,, but got the same error :!:
Am I misunderstanding how Insert method for collections is meant to be used :?:
3.19.3 is my ide version.

Thanks in advance,
C.
Online now: No Back to the top

Post

Posted
Rating:
#2
Guru
BruceSteers is in the usergroup ‘Guru’
/comp/gb/collection/insert - Gambas Documentation

Note where it says in red….
<COLOR color="#FF0000">Since 3.20</COLOR>

It means it does not exist in gambas 3.19.3

You'll need to upgrade gambas to 3.20 or do it a different way.

Code (gambas)

  1. Public Sub CollectionInsert(hCol As Collection, hAdd As Collection)
  2.   For Each hVar As Variant In hAdd
  3.     hClol.Add(hVar, hAdd.Key)
  4.   Next
  5.  
  6.  

Image

(Click to enlarge)

Online now: No Back to the top

Post

Posted
Rating:
#3
Regular
chrisRoald is in the usergroup ‘Regular’
Ah, yes. Read that as 3.2.0  :roll:
My cinnamon Software Manager only has 3.19.3 listed!  Synaptic doesn't even list gambas  :o
So any tips on how to do an upgrade will be gratefully received.

C.
Online now: No Back to the top

Post

Posted
Rating:
#4
Guru
BruceSteers is in the usergroup ‘Guru’
Go here…

Install package home:gambas:stable / gambas3

select your distro and click "Add repository and install manually"

then follow instructions :)
Online now: No Back to the top

Post

Posted
Rating:
#5
Regular
chrisRoald is in the usergroup ‘Regular’
Thanks Bruce,
     For Mint 21.2 (64bit), which ubuntu should I use :?:

C
Online now: No Back to the top

Post

Posted
Rating:
#6
Guru
BruceSteers is in the usergroup ‘Guru’
For Mint check out /etc/upstream-release/lsb-release for the ubuntu version

<HIGHLIGHT highlight="shell">
cat /etc/upstream-release/lsb-release
</HIGHLIGHT>
Online now: No Back to the top
1 guest and 0 members have just viewed this.