Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
LSET can't copy UDT's
#1
In QB you can use LSET to copy a complete UDT to another one.

Code:
type mytype
    id            as integer
    prv            as integer
    nxt            as integer
end type

dim as mytype a,b

a.id=10
a.prv=21
a.nxt=4

lset b,a ' <wrong type error !!!
print b.id,b.prv,b.nxt
    
sleep

FB gives a wrong type error.

It was a "blind" copy, at user's risk, but i found it very useful...

Perhaps the differnce should be documented in the Keywords list
Antoni
Reply
#2
I didn't know about, i should pay more attention to the quickhelp..

Anyways, support added, UDT's can be of any type and the destine's remainder will be filled with 0's if its size is less than the source UDT (i guess QB does the same).
Reply
#3
Yes this is how QB does it. And if the destination is smaller, the original data is trimmed (as with strings).
Thanks!
Antoni
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)