Among many "RETURN" warnings I'm getting, I'm also getting this:
METHOD CurrentJob()
LOCAL oReport AS RpReport
LOCAL cJobName,cPrint2Filename,cCaption,cMessage AS STRING
MEMVAR cSearch
SELF:Pointer := Pointer{ POINTERHOURGLASS }
cSearch := SELF:Server:FIELDGET(#CLCode)
oReport := RpReport{ SELF, "Joblist.RPT" }
IF oReport:IsValid
cJobName := "Current Jobs Listing"
cPrint2Filename := "REPORT.PRN"
cCaption := cAppVersion +" : Report Preview"
cMessage := "Printing in progress..."
oReport:FilterExpression := "details.CLcode == cSearch"
oReport:PrintPreview(cJobName,cPrint2Filename,cCaption,cMessage,,SW_SHOWMAXIMIZED)
SELF:Pointer := Pointer{ POINTERARROW }
ENDIF
oReport:Close()
RETURN SELF
The error message is:error XS9002: Parser: unexpected input 'ENDIF' 227,1 Window Addons.prg Business Manager 1
What am I doing wrong here please?
What am I doing wrong here please?
If your report fails, you are stuck with the hourglass :;, but apart from this I don't see a reason for the error, sorry.
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)
What am I doing wrong here please?
Hello,
IMHO the error stays in the entity before this one.
Please post the entire prg file.
Wolfgang
IMHO the error stays in the entity before this one.
Please post the entire prg file.
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
- lumberjack
- Posts: 727
- Joined: Fri Sep 25, 2015 3:11 pm
- Location: South Africa
What am I doing wrong here please?
As Karl indicated the code does seem fine. That error is normally associated with:BiggyRat wrote:Among many "RETURN" warnings I'm getting, I'm also getting this:The error message is:error XS9002: Parser: unexpected input 'ENDIF'Code: Select all
METHOD CurrentJob() LOCAL oReport AS RpReport LOCAL cJobName,cPrint2Filename,cCaption,cMessage AS STRING MEMVAR cSearch SELF:Pointer := Pointer{ POINTERHOURGLASS } cSearch := SELF:Server:FIELDGET(#CLCode) oReport := RpReport{ SELF, "Joblist.RPT" } IF oReport:IsValid cJobName := "Current Jobs Listing" cPrint2Filename := "REPORT.PRN" cCaption := cAppVersion +" : Report Preview" cMessage := "Printing in progress..." oReport:FilterExpression := "details.CLcode == cSearch" oReport:PrintPreview(cJobName,cPrint2Filename,cCaption,cMessage,,SW_SHOWMAXIMIZED) SELF:Pointer := Pointer{ POINTERARROW } ENDIF oReport:Close() RETURN SELF
Code: Select all
IF True
// IF True
ENDIF
ENDIF // Error unexpected ENDIF
- Why not strict type this method, METHOD CurrentJob() AS VOID|LOGIC
- MEMVAR cSearch, I would change that to LOCAL
Code: Select all
LOCAL cSearch AS STRING
oReport:FilterExpression := "details.CLcode == #v#":Replace("#v#", cSearch) // This might be a runtime error , is CLcode a C/N field?
- RETURN SELF // Do you really need to return the object?
Regards,
Code: Select all
RETURN [lSuccess] // Just preference, but a "cleaner" solution
______________________
Johan Nel
Boshof, South Africa
Johan Nel
Boshof, South Africa
- lumberjack
- Posts: 727
- Joined: Fri Sep 25, 2015 3:11 pm
- Location: South Africa
What am I doing wrong here please?
Hi Wolfgang,
Regards,
You are correct, I think the problem is in :FilterExpression("details.CLcode == cSearch"), which I tried to "fix" in my example.wriedmann wrote: IMHO the error stays in the entity before this one.
Regards,
______________________
Johan Nel
Boshof, South Africa
Johan Nel
Boshof, South Africa
What am I doing wrong here please?
Most likely it's the "MEMVAR", those are not supported (yet) and this desyncs the parser, reporting an error at a later line. Just convert it to a LOCAL as Johan suggested and the error will go away.
Although I assume you do use that MEMVAR later in filter expressions, so simply turning it them to a LOCAL will not be enough for you. If that's the case, then it is probably a good idea to wait a little bit more, until the X# runtime and compiler does support MEMVARs. Most of the base work has been done already, so it should not take too long.
Although I assume you do use that MEMVAR later in filter expressions, so simply turning it them to a LOCAL will not be enough for you. If that's the case, then it is probably a good idea to wait a little bit more, until the X# runtime and compiler does support MEMVARs. Most of the base work has been done already, so it should not take too long.
Chris Pyrgas
XSharp Development Team
chris(at)xsharp.eu
XSharp Development Team
chris(at)xsharp.eu
- lumberjack
- Posts: 727
- Joined: Fri Sep 25, 2015 3:11 pm
- Location: South Africa
What am I doing wrong here please?
Hi Chris,
Just have to " 'cSearch' " if a string type.
Regards,
If he has a "fixed" filter expression it can be overcome with the way I showed:Chris wrote: Although I assume you do use that MEMVAR later in filter expressions, so simply turning it them to a LOCAL will not be enough for you. If that's the case, then it is probably a good idea to wait a little bit more, until the X# runtime and compiler does support MEMVARs. Most of the base work has been done already, so it should not take too long.
Code: Select all
oReport:FilterExpression := "details.CLcode == #v#":Replace("#v#", cSearch)
Regards,
______________________
Johan Nel
Boshof, South Africa
Johan Nel
Boshof, South Africa