For loop syntax.
For loop syntax.
Just having a quick initial look at the 2.07 public release and VFP syntax therein.
It seems to not like forendfor, which is legal VFP, and insists on fornext. Is that by design ?
It seems to not like forendfor, which is legal VFP, and insists on fornext. Is that by design ?
For loop syntax.
Alan,
Did you set the dialect to FoxPro ?
If you did then it should automatically include the file "FoxProCmd.xh" which translates ENDFOR to NEXT
Robert
Did you set the dialect to FoxPro ?
If you did then it should automatically include the file "FoxProCmd.xh" which translates ENDFOR to NEXT
Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
The Netherlands
robert@xsharp.eu
For loop syntax.
Robert
I chose 'FoxPro Console Application' when creating the project.
I chose 'FoxPro Console Application' when creating the project.
For loop syntax.
I've added the .xh file in manually, verified that the dialect 's 'FoxPro', still doesn't like it.
Also set the dialect to Core, rebuilt, then back to FoxPro to see if something would kick in, but no.
Also set the dialect to Core, rebuilt, then back to FoxPro to see if something would kick in, but no.
- lumberjack
- Posts: 727
- Joined: Fri Sep 25, 2015 3:11 pm
- Location: South Africa
For loop syntax.
Hi Alan,
Added manually, do you mean you added at the top of your start.prg file?alanbourke wrote:I've added the .xh file in manually, verified that the dialect 's 'FoxPro', still doesn't like it. Also set the dialect to Core, rebuilt, then back to FoxPro to see if something would kick in, but no.
Code: Select all
#include "c:Program Files (x86)xsharpincludeFoxProCmd.xh"
______________________
Johan Nel
Boshof, South Africa
Johan Nel
Boshof, South Africa
- lumberjack
- Posts: 727
- Joined: Fri Sep 25, 2015 3:11 pm
- Location: South Africa
For loop syntax.
Hi Alan,
Ran fine this side first time.
Also tested with VS 2019 Community and ran fine first time.
Using VS 2017 Community I did and modified as follows:alanbourke wrote: I chose 'FoxPro Console Application' when creating the project.
Code: Select all
Using System
Using System.Collections.Generic
Using System.Linq
Using System.Text
Function Start() As Void Strict
Local i
For i = 1 To 10
? "Hello World! Today is ",ToDay()
WAIT
endfor
Return
Also tested with VS 2019 Community and ran fine first time.
______________________
Johan Nel
Boshof, South Africa
Johan Nel
Boshof, South Africa
For loop syntax.
OK here's what I have, VS 2019 Community:
If I replace 'next' with 'endfor' it's a problem.
Code: Select all
#include "c:program files (x86)xsharpincludefoxprocmd.xh"
using system
using system.collections.generic
using system.linq
using system.text
function start() as void strict
? "hello world! today is ",today()
local x as int
for x = 1 to 100
? x
next
wait
return
For loop syntax.
I started a new "FoxPro Console Application" from X# templates in VS2019, and EndFor is working fine for me. Compiles and runs no problem.
VS 2019 Ver 16.3.1, /Net Framework 4.7.2, X# 2.07
VS 2019 Ver 16.3.1, /Net Framework 4.7.2, X# 2.07
Code: Select all
Using System
Using System.Collections.Generic
Using System.Linq
Using System.Text
Function Start() As Void Strict
? "hello world! today is ",today()
Local x As Int
For x = 1 To 100
? x
EndFor
Wait
Return
For loop syntax.
BTW, in X# you can use either:
or
(notice space between the words.
Code: Select all
EndFor
Code: Select all
End For
For loop syntax.
I created a new FoxPro console application and pasted Matt's code in, still doesn't like 'endfor'.
Seems happy with 'end for' though, but that's not valid VFP syntax
Seems happy with 'end for' though, but that's not valid VFP syntax