Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
X# examples - Readability
Message
From
30/10/2019 13:27:11
 
 
To
30/10/2019 10:37:44
General information
Forum:
Visual FoxPro
Category:
VFP Compiler for .NET
Miscellaneous
Thread ID:
01671739
Message ID:
01671743
Views:
75
Hi Koen,
>Sys(1) = Julian date
>ans Sys(1234) does not exsist in VFP so I assume you are referring to sys() in .NET and not in VFP.
>For the readable I dont get it. What have these sys() functions to do with this piece of coding?

Actually everything, but thanks for the effort of looking up what those mean... No way anybody would actually know out the top of their heads the meaning of 1, 1234 and since there are thousands of them, need to look them up each time one has to use it...
ENUM SysType
  MEMBER Julian := 1
  ...
  MEMBER NotExist := 1234
  ....
END ENUM

&& In our code then
LOCAL myType AS SysType
....
SWITCH myType
  CASE Julian
    ? "Do what you need to do"
  CASE NotExist
    ? "Do the not exist thingy"
  ....
  OTHERWISE
    ? "Don't know "
END SWITCH
Johan Nel
George, South Africa
Friend of XSharp (FOX) member
E-mail : johan(dot)nel(at)xsinet(dot)co(dot)za
Web site : https://xsharp.info
X# runtime : https://github.com/X-Sharp/XSharpPublic
Radio talk : https://blog.aksel.com/2019/07/why-xsharp-might-be-tool-foxpro.html
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform