![xojo array xojo array](https://campsoftware.com/blogOld/files/pivottable.gif)
#XOJO ARRAY CODE#
When you run the now modified code, using the IDE Debugger feature to run the line of code where the Debugger has stopped, you’ll see how both Array variables ( ASource and ATarget) reveal that their dimensions are -1. If you want to see that for yourself, try to delete the previous breakpoint and put a new one in the last line of code added. Thus, and because they are references, all the operations we do on the source Array will be reflected in the target Array. When we use the assignement operator (=) to set the values (items) of an Array to another one, what in fact happens behind the scenes is that the target Array will store only a reference to the source Array (the right-side value of the assignement operator), and not a copy of the values/objects stored. That is, in practice we will be emptying the Array.Īs result of this operation you could expect that, while the contents of the ASource() variable are emptied, your ATarget() Array will continue storing their items. In this case we will be redimensioning the storage capacity of our ASource() Array with a total of 0 items. However, what happens if we add the following line of code at the end of our fragment of code?: Redim ASource(-1) (Navigate through the Debugger Inspector Panel to inspect these variables) If you set a breakpoint in the last line of code and execute your test app, then you’ll see that, as exepected, the contents of the ATarget() Array are the same that the ones stored by the ASource() Array. Try to write the following fragment in the Open Event of a new Xojo Project or Method created by yourself (don’t forget to call such method, if you decide to follow that path): Dim ASource() As Integer = Array(1,2,3,4,5,6,7,8) Of course, and at a first glance, this is the case. In this case, it’s also probable that you might be confused at first as to why you don’t get what you expected when assigning the contents of a source Array to a target Array via the assignment operator (“=”).Īfter all, when using the following snippet of code we could (wrongly) expect that the contents stored in the ATarget Array would be the same that the ones stored in the ASource Array. Upon rereading, if you must have separate canvases to respond to events (e.g.If you’re starting to program with Xojo, then you’ll probably soon find yourself in a situation where you need to use one of the Container types: Array.
![xojo array xojo array](https://blog.xojo.com/wp-content/uploads/2019/04/Acastat.png)
The only gotcha with object2D is that its coordinate system has 0,0 in the center of an object, not the top, left used everywhere else.
![xojo array xojo array](http://valentina-db.com/docs/dokuwiki/v8/lib/exe/fetch.php?w=800&tok=972bd7&media=valentina:products:vstudio:picts:vs_project_window2.png)
add this group to a picture (lets suppose 'myPicture' exists) An example might look like: dim pixmapA as new pixmapShape(pictureA)ĭim composite as new group2D //behaves much like an arrayĬomposite.append(new pixmapShape(pictureB)) //lacks variable name (see pixmapA)Ĭem(0).rotation=.9 //but still editable if you know its indexĬomposite.append(pixmapA) //on top and still addressable as 'pixmapA'
![xojo array xojo array](https://www.xojo3d.com/images/texture.png)
Late to the game, but you might have more control of your images by inserting them as pixmapShapes in a Group2D object in the Objects of a Picture in a single Canvas.Background.