I am getting there, I think, though it can be very a toilsome task.On the other hand a pointer to the Variations data, and its dimension would be cool.What does the Version actually hold to begin with The only way a Version can hold a byte assortment is by making use of a SAFEARRAY (Alternative kind VTARRAY or VTUI1).
Delphi Variant To Float How To Write TheCan be there a snappy efficient method to do this You may end up being capable to get some information from this older article: Quote Does anyone know how to write the content material of a Alternative to a Stream I have a picture packed into a version (using some third party components), and requires to move those information to a stream so I could use the LoadFromStreamSaveToFile methods. I understand I most likely have to use methods such as VarArrayLock() étc, but I havént maintained to get it running. Therefore some even more check ups on the real kind of the information saved in the version may become appropriate. Observe VarType. -- Philip Below (TeamB) Dont end up being a vampire ( ), make use of the newsgroup archives. And yes it might become easier making use of queries, but efficiency is paramount - this looks like the fastest option) I guess I could pass in a TField and possess a ladder if ThisField is TStringField after that. Yes I have observed some posts on the subject, but my want is slightly different. What I need to perform is handle a Alternative of ANY Kind and turn it into a byte range - nicely a pointer and a size to be precise. Actually a ShortInt would become a 1 component range - if you find what I imply. TField has an AsVariant real estate that grips such conversion rate for you. For some of the alternative data forms the real value is usually stored inside the record (up to 8 bytes), so for those the pointer to the data would be TVarData(Sixth is v).VInteger (all the data fields have the same balance, that can be: address). The size depends on VarType(Sixth is v), you could manage that with a Situation statement. For some sorts the tackle of the barrier would end up being TVarData(Sixth is v).VAny (the tip kept in that industry). Delphi Variant To Float Code In TheThe size of the data is after that dependent on what this tip factors at, for var0leString you would use size: lStrLenW(TVarData(Sixth is v).VOleStr) Sizeof(Widéchar); For BLOB areas you will obtain a alternative that consists of a variant assortment of bytes, fór those you cán make use of the code in the structure I posted to calculate the size, and the tackle is came back by VarArrayLock. If the alternatives you have got to convert come from a datasét that should include all the bases, unless you possess to offer with nested tables. Philip Below (TeamB) Dont be a vampire ( ), use the newsgroup records. But there can be one difference: the automated variant conversion rates believe that. ![]() Delphi Variant To Float Crack Down TheQuotation If you are not making use of TField to gain access to the DB columns, after that you will just possess to crack down the Alternative manually, web browser: var V: Alternative; G: Pointer; S: Integer; start V:.; situation VarType(V) of varShortInt: start G: V.VShortInt; H: SizeOf(ShortInt); end; varByte: begin In the finish I skinned my cat a little in a different way (not fully examined). The ideas and dimensions experienced to persist so that I could insert large quantities of information in a strike. ![]() I am obtaining right now there, I believe, though it is usually quite a toilsome job.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |