Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
X# examples - Hello world
Message
De
20/10/2019 16:21:31
 
 
À
20/10/2019 08:54:18
Information générale
Forum:
Visual FoxPro
Catégorie:
VFP Compiler for .NET
Divers
Thread ID:
01671443
Message ID:
01671588
Vues:
82
Hi Thomas
>> I note also you're making your arrays reference from 0 instead of 1. While more compatible with other languages,
>> it is not compatible with existing VFP / XBASE code. You might want to have some kind of SET ARRAYBASE TO 0 | 1
>> setting somewhere, which allows the base to be 1 instead of 0, in which case you should use:
Sorry maybe I was not clear enough. ALL XBase interfaces are 1 based, so no worry about 0 index. It is only .NET which is by default 0 based that are affected by the /az switch.

Question 1: Does this map over to Strings ?
clea
lx = "Do_xSharp"
? LEFT(lx,3)    && LEFT is an XBase function, hence it will always return "Do_"
? SUBSTR(lx, 4) && "xSharp" is the return value
? Left(lx,2) = Substr(lx,1,2)  && XBase functions the two functions will return exactly the same.
> Question 2: what happens if you get code from a coder working 1 based ? Lets say you want my Array-based-Collection class routines, well tested but coded 1 based ?
> That could end in a wreck, same as messing with UDFPARMS, as code is written "with a mind set". Only thing is to bury the array so no outsider can access it and wrap
> all indices in methods.
Ok, again no worry for XBase code, /az is only applicable to .NET Arrays. XBase features always 1 based. I interface a lot to c# asseblies hence I prefer to always have /az turned on.

> Question 3: What are the functions for AStartElement(myArray, "/az") and
Function AEndElement(@myArray, tcSwitch)
return Alen(myArray, m.tcSwitch)
> as my typical shorthand is for lnRun = 1 to Alen(laWork)... which could lead to serial FACEPALMs if you use my code recompiled to your switch or passed
> an array-parameter compiled under your switch ?...
Alen() is a XBase function hence always 1 to Length. .NET same except with /az set, it will be 0 to Length - 1
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform