How can it give context for an item that does not exist?
Use MessageBox instead and you can get context. ![]()
i’m retarded, but not that retarded ![]()
the point was : there is a right clic that says copy-all on debug line
this would be cool if it it would copied in this case:
window1.button1.pressed: this item does not exist messbox(”gggf“)
and copy does the same as copy-all in this case
this is to automate sending bugs to claude, right now, i send screen shots to claude, i’m wondering is there is a way to know when the xojo ide meet a bug, take a screenshot and send to claude
chat gpt said this typo means MsgBox LOL
I builded a xojo app using ide communication to get all errors and warning as text, and feed them into claude code…
as I asked here to have a new feature to export error messages as log files and it did not get done.
ok cool !!
can you put it on github ?
thanks !
Just FYI. You could use a combination of the “BuildPressed.xojo_script” and IDE Communicator to get closer.
While speaking about feature, I remember I read somewhere in the forum that we can highlight a variety of in all a Method, but I can’t find in which topic I read that. I know I can search for BL (if my var is BL) but it will highlight all words containing “BL”).
Geoff… Mr Xojo himself… never used WeakRef? That actually blows my mind!
I use it as much as I need. It helps wonderfully to prevent memory leaks, where references are kept in classes.
I often store references in dictionaries. And for a long time I stored the WeakRef value in that dictionary. For getting the actual object, a (helper) class method checks if the WeakRef object is Nil, then it checks if the value for that WeakRef is nill. In these cases, I will return Nil. Otherwise I return a cast of that object, created with the WeakRef value.
Works like a charm.
I just never had a need. Then I ended up with a situation where a property of a class was storing an object that needed a reference to the class instance in which it was stored. WeakRef was the solution to avoid a circular reference.
That’s how I ended up using WeakRef, Geoff…
That makes me think… would it be possible to add a feature like a “Weak Property”?
That would be a property, referring to a class, but in a WeakRef kind of way.
For the user, the property is just a reference to a class. But, under the hood, the property stores a WeakRef reference to that class. When the class instance goes out of scope, the property would return Nil. If it is still in scope, it returns that class instance. ![]()
Here’s a hint to combine the WeakRefs and the computed properties…
Private property mParentClass as WeakRef
property ParentClass as myClass
Getter as myClass
If mParentClass = Nil or mParentClass.Value = Nil then
Return Nil
End If
Return myClass(mParentClass.Value)
End Getter
Setter(value as myClass)
mParentClass = New WeakRef(value)
End Setter
That way you can still set & get without having to do the conversion of everywhere.
Now why doesn’t that work by using Operator_Convert?
Public Function Operator_Convert(theWeakRef as WeakRef) As Class1
if theWeakRef=nil then
return nil
end
if theWeakRef.Value=nil then
return nil
else
return class1(theWeakRef.Value)
end
End Function
This throws an IllegalCastException:
myClass1WeakRef=new WeakRef(new Class1)
dim localClass1 as class1
localClass1=myClass1WeakRef <---IllegalCastException
localClass1=Class1(myClass1WeakRef) <---explicitly cast works fine
Why in gods name would you do that???
To paraphrase JFK, “we do this not because it is smart, but because it’s at least theoretically possible”.
Yeah, it’s not a great idea. But I’m still befuddled as to why it throws an IllegalCastException. I’d think the compiler could see both sides of the assignment and link that up to the Operator_Convert.
thanks. in fact it is “XojoBuildPressed.xojo_script” that I have to use for that purpose.
sorry it took some time to build this. will sell it 50€ the app 100€ app with source code. send PM if interested.

