constant #String
I often need this and define it as 4, because :
Code: Select all
#String = 4
Debug #Byte
Debug #Word
Debug #Long
Debug #Float
Debug #String
Code: Select all
#String = 4
Debug #Byte
Debug #Word
Debug #Long
Debug #Float
Debug #String
Code: Select all
Structure Object
StructureUnion
b.b
w.w
l.l
f.f
s.s
EndStructureUnion
type.l
EndStructure
Why don't you create a .res file with all your customizations in it?Froggerprogger wrote:...the variables #Byte, #Word, etc. are not giving the length, but an Type-Identifier:
Atm they are defined as:
#Byte = 0
#Word = 1
#Long = 2
#Float = 3
#String = 4 would make it complete.
I use it often, because for some kind of SortAlgorithms/Queues/Stacks/Trees, etc. I use the following 'Objects' as elements:
where type.l holds the identifier and may be #Byte, ... , #Float, #String (and #Structure - of course i would love a further identifier #Structure as well, but I think not many people would need this)Code: Select all
Structure Object StructureUnion b.b w.w l.l f.f s.s EndStructureUnion type.l EndStructure
Code: Select all
; my customizations
#String = 4
*edit*Froggerprogger wrote:@Noah
Of course I could, I'm just wondering if this could be implemented in PB.
Each of PB's build-in types has it's own identfier - all but string - so introducing #String would make it complete.
Yes, I'll do so. But it's not so comfortable for sharing with other's. They would have to 'install' this resident, too, or to define this constant by hand with the same value, which could make complications with so easy names like #String (perhaps they already use it with another value).I just meant that until (or if) it gets added, you can always use the
resident file way until then.
At the moment #String would make 'the same sense' as #Byte, etc. already are doing. But of course a typeof() instruction would be cool in addition, if it would work e.g. on structureparameters, so we could copy a structure.wouldn't this only make real sense with a typeof() instruction?
I do not see any sense in this command!blueznl wrote:TypeOf()? pretty pretty please?