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

TOPIC: How to find explanation

How to find explanation 1 year 5 months ago #1

Hi

I was looking in this forum for a replacement of the ErrorBlock Method and i found this code and i try to understand :-)

TRY
// app execution here
CATCH e AS Exception
LOCAL cMessage AS STRING
cMessage := e:Message
DO WHILE e:InnerException != NULL_OBJECT
e := e:InnerException
cMessage += CRLF+e:Message
ENDDO
ErrorBox{NIL, cMessage}:Show()
END TRY

Here e will be defined as Exception , my problem is - where can i find the explanation of Exception or other Functions/Classes witch has no VO names?
do i have to look into the C# help ?
and if i found the same name, is it the same ?

Horst

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

How to find explanation 1 year 5 months ago #2

  • wriedmann
  • wriedmann's Avatar
  • Away
  • Posts: 1406
  • Karma: 6
Hi Horst,
The exception class comes from the .NET framework, best to use Google search and add C# to your search terms.
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
This email address is being protected from spambots. You need JavaScript enabled to view it.
www.riedmann.it - docs.xsharp.it

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

How to find explanation 1 year 5 months ago #3

Hi Horst,

Yes all the system classes are the same in x#, c# and any other .Net language, and they can be used in exactly the same way, that's one of the beauties of .Net. And in most aspects (apart from VO/xBase in general features and compatibility ), x# can be used in a very similar way to x#.

Chris
XSharp Development Team
chris(at)xsharp.eu

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

How to find explanation 1 year 5 months ago #4

  • Phil Hepburn
  • Phil Hepburn's Avatar
  • Offline
  • Posts: 737
  • Karma: 7
Hi Chris,

Nice to know that even you mixes up X# and C# from time to time.

Been there and got the tee-shirt ;-0)

Hope you are well and feeling good.

Cheers,
Phil.

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

How to find explanation 1 year 5 months ago #5

Hi Phil,

I use c# only when I need to do some testing with it :)
Or during the vulcan days, where the base rdd and ntx drivers (and a very small part of the base runtime) were written in c#. But personally I completely avoid using c# if I can.

Been doing well, thanks, hope you're doing fine also! Sorry, didn't get the t-shirt thing!

Chris
XSharp Development Team
chris(at)xsharp.eu

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

How to find explanation 1 year 5 months ago #6

Hi Horst,

I use search terms like 'msdn exception'. This leads to

msdn.microsoft.com/de-de/library/system....ption(v=vs.110).aspx

Above 'Exception Klasse' you will find the link to the complete class library.

msdn.microsoft.com/de-de/library/mt472912(v=vs.110).aspx

Both links lead to the german version.

It's the power of these .NET libraries that makes X# so powerful.

Frank

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

How to find explanation 1 year 5 months ago #7

Hi to all

Thanks for your words.
Frank said this make the .Net world powerfull. But for a beginner ist realy hard. i Show you a example, i found it in the MS help, there i found this Code.

msdn.microsoft.com/de-de/library/system....sharp#code-snippet-2

int loop1;
NameValueCollection coll;

//Load Form variables into NameValueCollection variable.
coll=Request.Form;
// Get names of all forms into a string array.
String[] arr1 = coll.AllKeys;
for (loop1 = 0; loop1 < arr1.Length; loop1++)
{
Response.Write("Form: " + arr1[loop1] + "<br>");
}

So, here i see: coll == Request.Form
But i cant see why they use the codeword ALLKEYS. what is Coll now ? a Array, a String . if ist a Array ist a multidim Array or a single one ? and why they dont use it directly in the Loop ?

You see, maybe .Net ist powerfull but when you have to many posibilities and no good help/describtion behind its not realy a good thing because you cant find the things you relay need.

i think, this HTTP Class of MS is also using the Basic function like GetEnv () etc .

So i will write my HTTP handling in clear X# / VO Code. And with the VO SDK Classes and Ivo Wessel Juno Class it will not be a hard thing to do that. (mostly works already)

and i hope, the X# Team does not Forget to make a good help ;-)

Horst

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

How to find explanation 1 year 5 months ago #8

Hi Horst,

above the example you find the type of form:

Type: System.Collections.Specialized.NameValueCollection

Follow the link. Now you are at

msdn.microsoft.com/de-de/library/system....ction(v=vs.110).aspx

There you find, under Eigenschaften:

AllKeys : Gets all the keys in the NameValueCollection.

Follow the link on AllKeys. Now you are at

msdn.microsoft.com/de-de/library/system....ction(v=vs.110).aspx

Here you read

Type: System.String[]

saying AllKeys is a .NET STRING array.

You see

String[] arr1 = coll.AllKeys;

in the example saying exactly the same.

You're right: at the beginning it's hard. But it's worth the time you spend on. Most scenarios can be done by a few lines of code once you understood the power of collections for example.

Tip: I would open all the links in new tabs. This way you can easy go forth and back. I know, sometimes you will have more than a dozen tabs open.

Good luck

Frank

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

How to find explanation 1 year 5 months ago #9

  • wriedmann
  • wriedmann's Avatar
  • Away
  • Posts: 1406
  • Karma: 6
Hi Horst,

the power of X# is the possibility to use different programminfg styles:
- you can use it like C# with only the .NET framework, but with xBase syntax.
- you can use it like VO with the VO runtime libraries and the VO functions
- you can mix both styles

Since you know VO, and your applications are written in VO, for sure you will adapt the VO style, but since the .NET framework contains a lot of functionality you are dreaming of in VO, earlier or later you will need to use functionalities from the .NET framework.

Other than the VO datatypes, there are a lot of new ones.
Please look particularly at the Collections. Collections are a sort of arrays, but since .NET does not know dynamic arrays like VO (you cannot add members to a .NET array), Collections take their place.
Please look here:
http://www.c-sharpcorner.com/UploadFile/736bf5/collection-in-C-Sharp/
and here
https://www.tutorialspoint.com/csharp/csharp_collections.htm

Regarding the documentation: the X# team can never document the .NET framework, but you will find much more documentation and much, much more samples you had ever in your VO programming. X# can use a syntax that is near to C#, and if you can read a bit of C#, you will solve nearly every problem.

Personally, I'm using more and more X# modules in my VO applications, because I cannot move them over yet, but I need functionalities from the .NET framework.

There is a lot to learn, and for sure sometimes you will get frustrated, but at the end you will have a lot of fun.

Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
This email address is being protected from spambots. You need JavaScript enabled to view it.
www.riedmann.it - docs.xsharp.it

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

How to find explanation 1 year 5 months ago #10

Hi Horst,

To answer your question about what AllKeys returns, here's from the help:

msdn.microsoft.com/de-de/library/system....lkeys(v=vs.110).aspx

So the AllKeys property returns a (single dimension) array of strings (string[]), which contains only the keys from the collection. And the code stores this array that results from AllKeys in an intermediate local variable (arr1), because every time this property is called, this array is generated again. So in order to make sure that this is called only once, the code uses the intermediate variable, it's just for performance reasons.

About documenting the .Net classes, as the guys said, we cannot do that, the size of the .Net framework is incredibly immense, I'm sure it has taken dozens or hundreds of people at MS to document it. And indeed, some times the documentation is not good enough, but after a few weeks that you will be used to it, it will seem a lot easier. We've all been through this process in the past.

Chris
XSharp Development Team
chris(at)xsharp.eu

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

How to find explanation 1 year 5 months ago #11

  • Phil Hepburn
  • Phil Hepburn's Avatar
  • Offline
  • Posts: 737
  • Karma: 7
Hi Chris,

My short comment was a very simple one really - your post had said something like "X# can be used like X# most of the time" when I think you meant "X# can be used like C# most of the time".

I then sympathised with you as in my eNotes I often find myself making similar mistakes. Its had to get it right all the time.

So my comment was about mixing up the terms X# and C# and not mixing up the programming code in apps.

I like you use X# all the time now that I don't need to reach out for C# code to do a task. I like X# and that fact that I can do everything I wish with it instead for having to mix my own DLLs.

The 'tee-shirt' comment is from a well know American / UK saying when a person is trying to show sympathy and understanding, and say that they also have done something similar. I think the full 'saying' is "been there, seen the film, got the tee-shirt".

I am looking forward to getting back into full-time X# coding this autumn and winter. I plan to do something very useful for guys coding in X# and using both XIDE and VS, and for guys using data in both DBFs as well as any SQL flavour. It will be a lot of work what I plan (details later) but first I must ask Meinhard if it may fit in with any plans he has for Cologne 2018. No point doing 5 months work if there is no room in the session plans for me ;-0)

Oh! and my plans have no WPF and XAML anywhere in sight ;-0)

Keep up the good work,
Kindest regards,
Phil.

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

How to find explanation 1 year 5 months ago #12

Hi Phil,

Ahhh, yeah, ok got it now :)
Hadn't noticed my typo, but then again that's what usually happens, most people do not realize their own typos :)

Looking forward to seeing your new stuff!

Chris
XSharp Development Team
chris(at)xsharp.eu

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

  • Page:
  • 1