Sizeof
-
- Posts: 606
- Joined: Nov 28, 2012 1:27
- Location: CA, USA moving to WA, USA
- Contact:
Sizeof
It would save some people a little time if it could be noted that this is an integer return.
The type makes a difference to some externals and header declarations.
Thank you.
David
correction: changed topic to 'sizeof'
The type makes a difference to some externals and header declarations.
Thank you.
David
correction: changed topic to 'sizeof'
Last edited by speedfixer on Oct 03, 2017 15:55, edited 1 time in total.
-
- Posts: 862
- Joined: May 05, 2015 5:35
- Location: Germany
Re: Typeof
Code: Select all
Dim As String a
#Print TypeOf(a)
STRING
Correct me if I'm wrong, but that doesn't look like an integer value to me.
-
- Posts: 606
- Joined: Nov 28, 2012 1:27
- Location: CA, USA moving to WA, USA
- Contact:
Re: Typeof
Code: Select all
' size_of.bas
' test the return type of 'sizeof'
dim as byte bbb
dim as integer iii
dim as long lll
#print typeof(sizeof(iii))
#print typeof(sizeof(lll))
bbb = sizeof(iii)
print bbb
bbb = sizeof(lll)
print bbb
Later: corrected
Yes, I see, this proves type of 'sizeof'.
(Yours tells us the type of a string, a.)
My mistake: the keyword title should have been: sizeof.
Stiil - isn't in docs what the type is of the return of either keyword.
I will check some more.
David
-
- Posts: 606
- Joined: Nov 28, 2012 1:27
- Location: CA, USA moving to WA, USA
- Contact:
Re: Sizeof
Description and other notes at 'typeof' are fine - no change requested there.
-
- Posts: 862
- Joined: May 05, 2015 5:35
- Location: Germany
Re: Sizeof
Errare humanum est. ;-)speedfixer wrote:My mistake: the keyword title should have been: sizeof.
Re: Sizeof
Exhaustive list of keywords where the return datatype is not specified precisely (one way or another) in the documentation:
- Sizeof
- Open
- Point
- __FB_DEBUG__
- __FB_ERR__
- __FB_MIN_VERSION__
- __FB_MT__
- __FB_OPTION_ESCAPE__
- __FB_OPTION_EXPLICIT__
- __Fb_Option_Gosub__
- __FB_OPTION_PRIVATE__
- __FB_OUT_DLL__
- __FB_OUT_EXE__
- __FB_OUT_LIB__
- __FB_OUT_OBJ__
- __FB_VER_MAJOR__
- __FB_VER_MINOR__
- __FB_VER_PATCH__
I hope I have not forgotten some others?
I think this is not of great interest for the pre-defined symbols (__ * __) ?
=>:
KeyPgOpen → fxm [Added the datatype of return value]
KeyPgSizeof → fxm [Added the datatype of return value]
KeyPgPoint → fxm [Added the datatype of return value]
- Sizeof
- Open
- Point
- __FB_DEBUG__
- __FB_ERR__
- __FB_MIN_VERSION__
- __FB_MT__
- __FB_OPTION_ESCAPE__
- __FB_OPTION_EXPLICIT__
- __Fb_Option_Gosub__
- __FB_OPTION_PRIVATE__
- __FB_OUT_DLL__
- __FB_OUT_EXE__
- __FB_OUT_LIB__
- __FB_OUT_OBJ__
- __FB_VER_MAJOR__
- __FB_VER_MINOR__
- __FB_VER_PATCH__
I hope I have not forgotten some others?
I think this is not of great interest for the pre-defined symbols (__ * __) ?
=>:
KeyPgOpen → fxm [Added the datatype of return value]
KeyPgSizeof → fxm [Added the datatype of return value]
KeyPgPoint → fxm [Added the datatype of return value]
-
- Posts: 606
- Joined: Nov 28, 2012 1:27
- Location: CA, USA moving to WA, USA
- Contact:
Re: Sizeof
Thank you.
I just saves some time and trouble when you need to know.
Example is interfacing directly with an external library.
I just saves some time and trouble when you need to know.
Example is interfacing directly with an external library.
-
- Posts: 8586
- Joined: May 28, 2005 3:28
- Contact:
Re: Sizeof
Hello fxm can you add the return type of KeyPgFreefile and make a link on the same page to the wikki page with the description how to get the real OS file HANDLE from FreeBASIC file number ?fxm wrote:I hope I have not forgotten some others?
Tank you
Joshy
Re: Sizeof
- The first paragraph "Syntax" defines the return type (Long).
- What is the precise page to link?
- What is the precise page to link?
-
- Posts: 8586
- Joined: May 28, 2005 3:28
- Contact:
Re: Sizeof
declare function Freefile ( ) as longfxm wrote:- The first paragraph "Syntax" defines the return type (Long).
How I could be so blind :-)
The problem I don't find it and was thinking you known the right page.fxm wrote:- What is the precise page to link?
I mean if you need the real file HANDLE = C runtime FILE ptr (32/64-bit) from long (32-bit) FreeFIle() number.
How ever thank you.
Joshy
Re: Sizeof
Yes, okay, I've done my memory work and I think the KeyPgFileattr page is the right (with a nice example of what you're looking for).
Documentation updated:
KeyPgFreefile → fxm [Added a link to FileAttr]
Documentation updated:
KeyPgFreefile → fxm [Added a link to FileAttr]