Here no crash, but I understand thank you. So when can a New fail (as mentioned in your last remark in the 1st post) if not when assigned to a fake address?fxm wrote:because:
Aborting due to runtime error 12 ("segmentation violation" signal) in ...\FBIde0.4.6r4_fbc1.06.0\FBIDETEMP.bas::()
This crashes 100% of time. But this not (for me):fxm wrote:(on 'var x = New(-1) UDT')[/list]
Code: Select all
var x = (New(-1) UDT)->Foo
***
I don't want to go too much off topic, but I'm trying various syntaxes of the placement new page, and some doesn't work. For instance this one works:
Code: Select all
var x = (New(0) UDT[-1] {any})->Foo
Code: Select all
var x = (New(0) UDT (any))->Foo
Of course I had an already initialised field (ii = 9). But this was really difficult to figure out if the -1 is allowed or not (what meaning of it?), if this was a problem of the type of braces (there are many types of braces even for the 'any')... And the compiler thinks that we want to use New[] or the dereferencing operator, depending on the brackets in use for any.
I think humbly that in some future there will be the need to review this page. At least a second example with a list of all possible syntax would help.
End of the off topic... About the -1 in the count, it leaves me very puzzled.