fbpx
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: VAR vs. explicit Type references in Foreach command....

VAR vs. explicit Type references in Foreach command.... 4 months 1 week ago #7672

  FoxProMatt_MattSlay's Avatar Topic Author FoxProMatt_MattSlay Offline Posts: 149
Notice in Visual Studio, if I have a Foreach command I can get intellisense for objects inside the block if I explicitly reference the Type of the item I am iterating over (Foreach Customer as Customer ...):



However, if I use the "lazy" VAR method, it will not give intellisense on the Customer object inside the Foreach loop (Foreach VAR Customer ...):

Attachments:

Please Log in or Create an account to join the conversation.

Last edit: by FoxProMatt_MattSlay.

VAR vs. explicit Type references in Foreach command.... 4 months 1 week ago #7675

  lumberjack's Avatar lumberjack Offline Posts: 494

mattslay wrote: Notice in Visual Studio, if I have a Foreach command I can get intellisense for objects inside the block if I explicitly reference the Type of the item I am iterating over (Foreach Customer as Customer ...):
However, if I use the "lazy" VAR method, it will not give intellisense on the Customer object inside the Foreach loop (Foreach VAR Customer ...):

Have you tested if in c# it actually does work during lazy var declaration?
If yes, then it probably needs to get fixed.
If no, think you guess, if c# don't it is on the "nice" to-do list.
I do think it would be nifty if not in c# though but will not demand it then.
Regards,
______________________
Johan Nel
George, South Africa

Please Log in or Create an account to join the conversation.

VAR vs. explicit Type references in Foreach command.... 4 months 1 week ago #7676

  Fabrice's Avatar Fabrice Offline Posts: 52
Hi Matt,
that is where you discover that X# and it's Visual Studio integration is still a work-in-progress :
I can say that easily, because that's part of my task ;)

I've started to add some support to VAR declarations, ie:
LOCAL obj AS TestClass
VAR guess:= obj:ToString()

Then if you type, guess:
you will have the members of String type in the list.

But you are right, FOREACH support is still to be done.

Fab.

Please Log in or Create an account to join the conversation.

VAR vs. explicit Type references in Foreach command.... 4 months 1 week ago #7679

  FoxProMatt_MattSlay's Avatar Topic Author FoxProMatt_MattSlay Offline Posts: 149

lumberjack wrote: Have you tested if in c# it actually does work during lazy var declaration?


Johan - Yes, no compile-time errors, and indeed it runs just fine at execution time when I use the VAR method.

Please Log in or Create an account to join the conversation.

Last edit: by FoxProMatt_MattSlay.

VAR vs. explicit Type references in Foreach command.... 4 months 1 week ago #7680

  FoxProMatt_MattSlay's Avatar Topic Author FoxProMatt_MattSlay Offline Posts: 149
Fabrice - here is another issue...

Notice that even when I use explicit Type reference, if I then attempt to use the "i" prefix for interpolation inside a string using the {Object:Property} interpolation syntax, it does not give intellisense:

Attachments:

Please Log in or Create an account to join the conversation.

Last edit: by FoxProMatt_MattSlay.

VAR vs. explicit Type references in Foreach command.... 4 months 1 week ago #7681

  Fabrice's Avatar Fabrice Offline Posts: 52
Ok,...in my ToDo list...
As you can notice, nothing in VS Editor (Intellisense, QuickInfo, ...) is automatic; we have to implement all tools by ourselves, so some features are still missing, but we are making progress ;)

Please Log in or Create an account to join the conversation.

VAR vs. explicit Type references in Foreach command.... 4 months 1 week ago #7682

  robert's Avatar robert Offline Posts: 1048
Matt,

To add to what Fabrice said: adding a new feature to the language and the compiler is sometimes easier than adding support for our language to VS.

Robert
XSharp Development Team
The Netherlands
This email address is being protected from spambots. You need JavaScript enabled to view it.

Please Log in or Create an account to join the conversation.

VAR vs. explicit Type references in Foreach command.... 4 months 1 week ago #7683

  lumberjack's Avatar lumberjack Offline Posts: 494
Hi Matt,

mattslay wrote: Fabrice - here is another issue...
Notice that even when I use explicit Type reference, if I then attempt to use the "i" prefix for interpolation inside a string using the {Object:Property} interpolation syntax, it does not give intellisense:

I agree that there are things not working, lots of these were already discussed many times, we as a user base currently accept and live with it for the moment. We know the pressure is on the DevTeam to deliver. We understand as a VO/Vulcan community where we came from. We were left in a situation similar to what you guys had with VFP 9.0. Vulcan gave hope to VO users, it did not deliver as promised/expected. X# is already a full feature rich language as is. To go that step further to put language packs in is remarkable. Not like MS announced, if you want a migration path, start learning VB.NET/c#. I think if X# was announced that is it, take it or leave it as is, in Core format, it is already a 100% better alternative than migrating to VB.NET/c#, it is not a total rewrite from scratch. It will take years for the current stable release to get so far behind c# that it is not usable anymore.

It took courage to do what Robert took onto himself, no big corporate money backing him, for the love of the XBase language. He could have stopped there, VO/Vulcan community have a future. No he did not stop there, he made a commitment to unite the various XBase languages under 1 umbrella giving all of them the opportunity to step into .NET with a syntax close to what they used to. We need to give him support and a little bit of mercy for that, I believe we need to focus on the positives, e.g.
  • How well does the X# compiler compares to c# feature wise
  • How close are we already converting code from the VFP compiler syntax to X# syntax, etc.
  • Is X# positioned correctly between the XBase world and .NET, etc.
  • What features in X# is not supported in VFP, VO, Vulcan, Harbour, XBase++, etc.
  • The power of the pre-processor, the XBase language is still evolving!
I think the available far outweigh the not supported yet. It is not, no we not going to support it, there are just more important stuff to first focus on at the moment.

Trust me, Robert made VO2.5-2.8 what it was, otherwise VO would have died 15+ years ago. X# compared to VO/Vulcan is already miles ahead and I would say even ahead of c# in some cases. Yeah there are still users who bash VS and XIDE compared to the IDE in VO. Fact of the matter is, if I have Notepad I can produce code that the compiler can understand. I remember in my Clipper days, I used the Borland Turbo Pascal editor to do all my Clipper code in. No press of the button to compile/run. I was clever and could from exiting the TP IDE have my compiler going in a second, I just had to type "c" <Enter> lots of SET this and that in bat files, I was efficient. Done compiling hit "e" <enter> I am back in the editor where my cursor last was etc. Took split seconds. And no I don't want to use Notepad, XIDE and VS are miles ahead as editors/designers even with not implemented yet features.

Ok think you get my drift, not to chase you away, I just believe we need to see things in perspective. IDE is important, but I rather work with a crappy IDE than have a crappy compiler.
Just my ZAR 2c = US$0.02/14.667

We will speak soon again!
______________________
Johan Nel
George, South Africa

Please Log in or Create an account to join the conversation.

  • Page:
  • 1