Extending a String Object
BlitzMax Forums/BlitzMax Programming/Extending a String Object
| ||
Type mavString Extends String I get an error "expected identifier but encountered String" How can i extend the string class? |
| ||
You can't do that with 'String' |
| ||
String is a native type, its a like trying to extend an object marked final, or an array you could always make your own type that has a string as a field... |
| ||
pretty much lame. thanks |
| ||
Wouldn't that be '...Extends TString' ? Russell |
| ||
Some internal types are not extendable like String, TGadget and a few others Thats because they only exist as C++ objects but not as real BM objects which is needed for extension. |
| ||
I wish there was a TArray to extend as well. |
| ||
I like "Chris C"s idea. Just create your own type with a TArray / String / TGadget attached as Field. I think you can do everything you can do when directly extending. |
| ||
just a bit more of a hasile. I rather just extend and use all the methods in parallel. |