In Vo and Vulcan I could write:
IF (ptrnew := FCreate(cFile)) = 0xFFFFFFFF //F_ERROR
RETURN ""
ENDIF
Now the Fcreate function returns VOID, how can I handle the error?
Thank you
Danilo
Fcreate function
Fcreate function
Danilo,
It returns a pointer just like in VO.
What makes you think it returns a VOID ?
Robert
It returns a pointer just like in VO.
What makes you think it returns a VOID ?
Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
The Netherlands
robert@xsharp.eu
- lumberjack
- Posts: 729
- Joined: Fri Sep 25, 2015 3:11 pm
- Location: South Africa
Fcreate function
Danilo,
Which version of X#? It seems you might not have Bandol 9... From ILSpy:
Which version of X#? It seems you might not have Bandol 9... From ILSpy:
Code: Select all
// XSharp.Core.Functions
public static method FCreate(cFile as string ) as IntPtr
return FCreate2(cFile, 0u)
______________________
Johan Nel
Boshof, South Africa
Johan Nel
Boshof, South Africa
- softdevo@tiscali.it
- Posts: 191
- Joined: Wed Sep 30, 2015 1:30 pm
Fcreate function
Hi Robert,
So it gives me error
LOCAL ptrnew AS PTR
IF (ptrnew := FCreate(cFile)) = 0xFFFFFFFF //F_ERROR
RETURN ""
ENDIF
error XS0019: Operator '==' cannot be applied to operands of type 'void*' and 'dword' 198,4
Compilation failed (1 error)
So instead it works
LOCAL ptrnew AS DWORD
IF (ptrnew := FCreate(cFile)) = 0xFFFFFFFF //F_ERROR
RETURN ""
ENDIF
Danilo
So it gives me error
LOCAL ptrnew AS PTR
IF (ptrnew := FCreate(cFile)) = 0xFFFFFFFF //F_ERROR
RETURN ""
ENDIF
error XS0019: Operator '==' cannot be applied to operands of type 'void*' and 'dword' 198,4
Compilation failed (1 error)
So instead it works
LOCAL ptrnew AS DWORD
IF (ptrnew := FCreate(cFile)) = 0xFFFFFFFF //F_ERROR
RETURN ""
ENDIF
Danilo
- softdevo@tiscali.it
- Posts: 191
- Joined: Wed Sep 30, 2015 1:30 pm
Fcreate function
Version X# Bandol beta 9 (2.0.0.9)
I solved that:
LOCAL ptrnew AS DWORD // Not PTR
IF (ptrnew := FCreate(cFile)) = 0xFFFFFFFF //F_ERROR
RETURN ""
ENDIF
Danilo
I solved that:
LOCAL ptrnew AS DWORD // Not PTR
IF (ptrnew := FCreate(cFile)) = 0xFFFFFFFF //F_ERROR
RETURN ""
ENDIF
Danilo
Fcreate function
Danilo,
I think F_ERROR needs to be redefined inside the runtime. It is now defined as :
DEFINE F_ERROR := -1
but it should become
DEFINE F_ERROR = new IntPtr(-1);
Will change that for the next build.
Then you can change the code back and use F_ERROR instead of the 0xFFFFFFFF
Robert
I think F_ERROR needs to be redefined inside the runtime. It is now defined as :
DEFINE F_ERROR := -1
but it should become
DEFINE F_ERROR = new IntPtr(-1);
Will change that for the next build.
Then you can change the code back and use F_ERROR instead of the 0xFFFFFFFF
Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
The Netherlands
robert@xsharp.eu