variables arg with v_arg and v_next

General discussion for topics related to the FreeBASIC project or its community.
Post Reply
aloberoger
Posts: 507
Joined: Jan 13, 2009 19:23

variables arg with v_arg and v_next

Post by aloberoger »

since v_arg and va_next support the VARIANT , why not to allow the writing of varaint in parameter? like in C or C++


exemple:

Code: Select all

Function OLEMethod Cdecl (nType  As Integer,pvResult as VARIANT Ptr,pDisp as IDispatch Ptr,ptName As LPOLESTR ,cArgs As Integer=0, ...) As HRESULT
  ......
end function

'usage: 


'now:           
               Dim As VARIANT x
		x.vt = VT_I4
		x.lVal = nSize
		m_hr=OLEMethod(DISPATCH_PROPERTYPUT, NULL, pFont, OLESTR("Size"), 1, @x)


'request:   
    m_hr=OLEMethod(DISPATCH_PROPERTYPUT, NULL, pFont, OLESTR("Size"), 1, x)
Tourist Trap
Posts: 2958
Joined: Jun 02, 2015 16:24

Re: variables arg with v_arg and v_next

Post by Tourist Trap »

I think variants are deprecated ourdays. I don't know if you've noticed, but va_... stuff is not exactly as C in FB. If I remember well the last item for instance when calling next successively, is not known. Unless this is also the case in C?
aloberoger
Posts: 507
Joined: Jan 13, 2009 19:23

Re: variables arg with v_arg and v_next

Post by aloberoger »

tourist trap wrote
I think variants are deprecated ourdays ...
If true then windows is deprecated too, at least for most sharing tasks
Post Reply