Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.clipper.visual-objects > #8130
| Message-ID | <555F7706.9080906@heliks.nl> (permalink) |
|---|---|
| Date | 2015-05-22 20:35 +0200 |
| Newsgroups | comp.lang.clipper.visual-objects |
| From | Robert van der Hulst <robert@heliks.nl> |
| Subject | Re: Visual Studio Vulcan.Net Unknown Type |
| References | <9d689b10-0ee8-4d5f-b28e-20192081c87d@googlegroups.com> <mjnhuh$8p2$1@news.albasani.net> |
No, definitely NOT a bug.
System.DateTime.Now is a static property of the DateTime structure. This
returns an Instance of the DateTime structure
ToShortTimeString() is a method of the DateTime structure.
Vulcan uses the ":" operator for method calls on instances, and the "."
for namespace delimiters and static method calls and static properties
So the correct Vulcan syntax is:
System.DateTime.Now:ToShortTimeString()
^ ^ ^
a b c
a = Namespace delimiter = Dot
b = Static Property access = Dot
c = Instance method call = Colon
The confusing thing is that C# and VB use Dots for all three, which is
why the following code could also be a call to the static method
ToShortTimeString() in the System.DateTime.Now class/structure
Robert
> Gary,
>
> It likes a bug in Vulcan. ToShortTimeString() is not recognized by
> the vulcan intellisense parser and compiler.
>
> Jamal
>
> "Gary" wrote in message
> news:9d689b10-0ee8-4d5f-b28e-20192081c87d@googlegroups.com...
>
> Hi,
>
> I am trying to compile and run the following code:
>
>
> // CodeFile1.prg
> #using System
>
> FUNCTION Start() AS VOID
>
> Console.WriteLine (System.DateTime.Now.ToShortTimeString() )
> Console.ReadKey ()
> RETURN
>
> The error I receive is:
>
> Error 1 'System.DateTime.Now' : unknown type (are you missing an
> assembly reference?)
>
> This is driving me nuts. Any suggestions?
>
> Thanks
> .
>
--
Robert van der Hulst
robert@heliks.nl
Back to comp.lang.clipper.visual-objects | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Visual Studio Vulcan.Net Unknown Type Gary <gkeefe109@gmail.com> - 2015-05-22 07:37 -0700
Re: Visual Studio Vulcan.Net Unknown Type "Jamal Assaf" <someone@example.com> - 2015-05-22 11:28 -0400
Re: Visual Studio Vulcan.Net Unknown Type Robert van der Hulst <robert@heliks.nl> - 2015-05-22 20:35 +0200
Re: Visual Studio Vulcan.Net Unknown Type "Jamal Assaf" <someone@example.com> - 2015-05-22 22:42 -0400
Re: Visual Studio Vulcan.Net Unknown Type Robert van der Hulst <robert@heliks.nl> - 2015-05-23 14:58 +0200
Re: Visual Studio Vulcan.Net Unknown Type Gary <gkeefe109@gmail.com> - 2015-05-29 08:30 -0700
csiph-web