Format suddenly doesn't work 
Author Message
 Format suddenly doesn't work

My Format function suddenly doesn't work. It is only provided one
prototype - the one with 3 parameters.

So this generates

Return lNumerator.ToString & " (" & Format((lNumerator / lDenominator),
"0%") & ")"

generates this error:

C:\Documents and
Settings\sraymond\VSWebCache\licensing\Classes\modMain.vb(76): Argument not
specified for parameter 'format' of 'Public Shared Overloads Function
Format(enumType As System.Type, value As Object, format As String) As
String'.

Thanks,
Steve



Sat, 29 Jan 2005 11:55:26 GMT  
 Format suddenly doesn't work
Seems like you have "import"ed some Type that contains the 'Format(enumType
As System.Type, value As Object, format As String) As
String'. This is ending up hiding the Format function in the standard VB
runtime.

So a workaround is to specify that you want to use the Format in the VB
runtime by fully qualifiying the name:
Microsoft.VisualBasic.Format((lNumerator / lDenominator), "0%")

If you have many uses of this Format function in the code, a shorter way of
doing this would be

Imports VBRuntime = Microsoft.VisualBasic    'at the top of your source
file, but below the Option statements
and then use it as VBRuntime.Format((lNumerator / lDenominator), "0%")

thanks,
VB Team

--
This posting is provided "AS IS" with no warranties, and confers no rights.


Quote:
> My Format function suddenly doesn't work. It is only provided one
> prototype - the one with 3 parameters.

> So this generates

> Return lNumerator.ToString & " (" & Format((lNumerator / lDenominator),
> "0%") & ")"

> generates this error:

> C:\Documents and
> Settings\sraymond\VSWebCache\licensing\Classes\modMain.vb(76): Argument
not
> specified for parameter 'format' of 'Public Shared Overloads Function
> Format(enumType As System.Type, value As Object, format As String) As
> String'.

> Thanks,
> Steve



Sun, 30 Jan 2005 04:54:40 GMT  
 Format suddenly doesn't work
Ahhhhh. OK. Don't know what the hell I imported, though.



Quote:
> Seems like you have "import"ed some Type that contains the
'Format(enumType
> As System.Type, value As Object, format As String) As
> String'. This is ending up hiding the Format function in the standard VB
> runtime.

> So a workaround is to specify that you want to use the Format in the VB
> runtime by fully qualifiying the name:
> Microsoft.VisualBasic.Format((lNumerator / lDenominator), "0%")

> If you have many uses of this Format function in the code, a shorter way
of
> doing this would be

> Imports VBRuntime = Microsoft.VisualBasic    'at the top of your source
> file, but below the Option statements
> and then use it as VBRuntime.Format((lNumerator / lDenominator), "0%")

> thanks,
> VB Team

> --
> This posting is provided "AS IS" with no warranties, and confers no
rights.



> > My Format function suddenly doesn't work. It is only provided one
> > prototype - the one with 3 parameters.

> > So this generates

> > Return lNumerator.ToString & " (" & Format((lNumerator / lDenominator),
> > "0%") & ")"

> > generates this error:

> > C:\Documents and
> > Settings\sraymond\VSWebCache\licensing\Classes\modMain.vb(76): Argument
> not
> > specified for parameter 'format' of 'Public Shared Overloads Function
> > Format(enumType As System.Type, value As Object, format As String) As
> > String'.

> > Thanks,
> > Steve



Sun, 30 Jan 2005 11:37:08 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. HELP! trim suddenly doesn't work

2. FORMAT function doesn't work in Access 97

3. Format time doesn't work

4. Format function doesn't work in UserControl

5. Format Message doesn't work

6. fRefreshLinks Doesn't work if path doesn't exist

7. Windows Service Calling VB6 dll doesn't work but works with VB6

8. IE3 doesn't work after working with webbrowser control

9. Why LoadPicture() works on local pathes and doesn't work on the URLS

10. Work Around doesn't work for RichTextBox

11. Passing a Parameter its works and it doesn't work

12. Works/Doesn't Work

 

 
Powered by phpBB® Forum Software