Do you mean that the editor does not highlite it (which is indeed a known problem), or does the compiler not accept it either when building? Tested it here and seems to work ok.alanbourke wrote: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
For loop syntax.
For loop syntax.
Chris Pyrgas
XSharp Development Team
chris(at)xsharp.eu
XSharp Development Team
chris(at)xsharp.eu
For loop syntax.
It doesn't highlight it, and it throws a compiler error XS1003, Syntax Error, 'NEXT' expected.
For loop syntax.
Could you please zip the solution folder and send it so we can have a look?
Chris Pyrgas
XSharp Development Team
chris(at)xsharp.eu
XSharp Development Team
chris(at)xsharp.eu
-
- Posts: 774
- Joined: Wed May 17, 2017 8:50 am
- Location: Germany
For loop syntax.
Guys,
Didn´t notice it before, but this code - with the dialect setting <VO> or <Foxpro> - compiles and runs. To see what´s going on i compiled the source with the -ppo+ -showincludes+ -nostddefs+ settings - and the ppo file content still shows "END FOR". I´ve looked at the X# Help but i didn´t find any hint that "END FOR" is a legal statement - but it is
BTW. I´m pretty sure that Alan didn´t select in VS the <Foxpro> dialect, so a not preproccessed "ENDFOR" throws the XS1003, Syntax Error, 'NEXT'
regards
Karl-Heinz
Didn´t notice it before, but this code - with the dialect setting <VO> or <Foxpro> - compiles and runs. To see what´s going on i compiled the source with the -ppo+ -showincludes+ -nostddefs+ settings - and the ppo file content still shows "END FOR". I´ve looked at the X# Help but i didn´t find any hint that "END FOR" is a legal statement - but it is
BTW. I´m pretty sure that Alan didn´t select in VS the <Foxpro> dialect, so a not preproccessed "ENDFOR" throws the XS1003, Syntax Error, 'NEXT'
Code: Select all
FUNCTION Start( ) AS VOID
LOCAL i AS INT
FOR i := 1 TO 3
? i
END FOR // <----
FOREACH VAR c IN { "one" , "two" , "three" }
? c
END FOR // <---
RETURN
Karl-Heinz
For loop syntax.
"BTW. I´m pretty sure that Alan didn´t select in VS the <Foxpro> dialect,"
I ran the Visual Studio wizard to create a Foxpro Console Application, which sets the dialect automatically.
'End For' might be valid in other dialects, but it's not valid Visual Foxpro.
I ran the Visual Studio wizard to create a Foxpro Console Application, which sets the dialect automatically.
'End For' might be valid in other dialects, but it's not valid Visual Foxpro.
For loop syntax.
Alan,
VS17 community on W8.1/64 German, 2.07 FoxVersion.
New project / FoxPro Console app
modified to
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
// endfor
END FOR
WAIT
RETURN
CTRL-F5 compiles and runs in all three "closing" versions.
VS17 community on W8.1/64 German, 2.07 FoxVersion.
New project / FoxPro Console app
modified to
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
// endfor
END FOR
WAIT
RETURN
CTRL-F5 compiles and runs in all three "closing" versions.
Regards
Karl
(on Win8.1/64, Xide32 2.20, X#2.20.0.3)
Karl
(on Win8.1/64, Xide32 2.20, X#2.20.0.3)
- lumberjack
- Posts: 729
- Joined: Fri Sep 25, 2015 3:11 pm
- Location: South Africa
For loop syntax.
Hi Alan,
Run the Wizard? I assume you mean File/New/Project, Select Foxpro Console Application and Next button to create?alanbourke wrote:"BTW. I´m pretty sure that Alan didn´t select in VS the <Foxpro> dialect,"
I ran the Visual Studio wizard to create a Foxpro Console Application, which sets the dialect automatically.
'End For' might be valid in other dialects, but it's not valid Visual Foxpro.
______________________
Johan Nel
Boshof, South Africa
Johan Nel
Boshof, South Africa
For loop syntax.
Right, at the link below is a 5MB MP4 screen recording showing installation of XSharp and then what I'm doing in Visual Studio.
Demo
Demo
For loop syntax.
Alan,
Thanks for the video. I am looking into this
Robert
Thanks for the video. I am looking into this
Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
The Netherlands
robert@xsharp.eu