Use Nullables with DotNetInterop

BeliasBelias Member Posts: 2,998
I just faced a problem where i had to call a webservice through a WCF function that accepts a System.Nullable'1 as parameter (i actually wanted to just pass a simple integer). I tried to declare a systemnullable variable but the following code does not compile
Systemnullable := myinteger;
After some headbanging and some luck, i just found that if you box the integer into a variant, nav compiles and the code works...ok!
myvariant := myinteger;
systemnullable := myvariant;
I hope it helps somebody in the future, bye!
-Mirko-
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog

Comments

  • Wisa123Wisa123 Member Posts: 308
    Damn i couldve used that a few months ago :'(

    Thanks for sharing tho.
    Austrian NAV/BC Dev
  • JuhlJuhl Member Posts: 724
    Create a System.Nullable DOTNET variable
    Follow me on my blog juhl.blog
  • BeliasBelias Member Posts: 2,998
    SystemNullable actually is a System.Nullable DOTNET variable
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
Sign In or Register to comment.