Revision history for KeyPgOpStrptr


Revision [22047]

Last edited on 2017-12-21 23:55:10 by fxm [Typo]
Additions:
**Note:** For a variable length string, the operator returns a ##[[KeyPgZstring|Zstring]] [[KeyPgConstQualifier|Const]] [[KeyPgPtr|Ptr]]## (because returning by reference the string's characters pointer set in the string descriptor, this one is to be considered as read only). If the keyword ##[[KeyPgVar|Var]]## is used to declare/initialize a user pointer from ##**Operator Strptr**##, this user pointer is also defined as read only (it can not be modified further).
Deletions:
**Note:** For a variable length string, the operator returns a ##[[KeyPgZstring|Zstring]] [[KeyPgConstQualifier|Const]] [[KeyPgPtr|Ptr]]## (because returning by reference the string's characters pointer set in the string descriptor, this one is to be considered as read only). If the keyword ##[[KeyPgVar|Varg]]## is used to declare/initialize a user pointer from ##**Operator Strptr**##, this user pointer is also defined as read only (it can not be modified further).


Revision [22045]

Edited on 2017-12-21 08:07:45 by fxm [Added note on the Const Ptr returned for a variable length string]
Additions:
When a fixed length string is modified, the string's character data address (returned by ##**Operator Strptr**##) is unchanged.
**Note:** For a variable length string, the operator returns a ##[[KeyPgZstring|Zstring]] [[KeyPgConstQualifier|Const]] [[KeyPgPtr|Ptr]]## (because returning by reference the string's characters pointer set in the string descriptor, this one is to be considered as read only). If the keyword ##[[KeyPgVar|Varg]]## is used to declare/initialize a user pointer from ##**Operator Strptr**##, this user pointer is also defined as read only (it can not be modified further).
Deletions:
When a fixed length string is modified, the string's character data address (returned by ##**Operator Strptr**##) is unchanged


Revision [21518]

Edited on 2016-07-28 11:50:50 by fxm [Added that for a var-len string, Strptr value may change if the string is modified]
Additions:
When a fixed length string is modified, the string's character data address (returned by ##**Operator Strptr**##) is unchanged


Revision [21517]

Edited on 2016-07-28 11:32:51 by fxm [Added that for a var-len string, Strptr value may change if the string is modified]
Additions:
When a variable length string is modified, the address of its descriptor remains always the same, but the the string's character data address (returned by ##**Operator Strptr**##) may change (like any allocated memory that must be reallocated).


Revision [21516]

Edited on 2016-07-28 04:22:54 by fxm [Updated also the 'Result' paragraph]
Additions:
Returns a ##[[KeyPgZstring|Zstring]] [[KeyPgPtr|Ptr]]## to a string's character data (null value in case of empty string).
Deletions:
Returns a ##[[KeyPgZstring|Zstring]] [[KeyPgPtr|Ptr]]## to a string's character data.


Revision [21515]

Edited on 2016-07-28 01:20:45 by fxm [In case of emptry string, operator returns a null pointer]
Additions:
In case of empty ##[[KeyPgString|string]]## (only for variable length strings), ##**Operator Strptr**## returns a null pointer.


Revision [21063]

Edited on 2016-03-13 08:40:47 by fxm [Formatting]
Additions:



Revision [20415]

Edited on 2016-02-10 16:05:40 by DkLwikki [Update link format]
Additions:
[[KeyPgDeclare|declare]] [[KeyPgOperator|operator]] **Strptr** ( [[KeyPgByref|byref]] //lhs// [[KeyPgAs|as]] [[KeyPgString|string]] ) [[KeyPgAs|as]] [[KeyPgZstring|zstring]] [[KeyPgPtr|ptr]]
[[KeyPgDeclare|declare]] [[KeyPgOperator|operator]] **Strptr** ( [[KeyPgByref|byref]] //lhs// [[KeyPgAs|as]] [[KeyPgWstring|wstring]] ) [[KeyPgAs|as]] [[KeyPgZstring|zstring]] [[KeyPgPtr|ptr]]
Returns a ##[[KeyPgZstring|Zstring]] [[KeyPgPtr|Ptr]]## to a string's character data.
This operator returns a ##[[KeyPgZstring|Zstring]] [[KeyPgPtr|Ptr]]## that points to the beginning of a string's character data. ##**Operator Strptr**## is the proper method for acquiring the address of a string's character data.
Note that when passed a ##[[KeyPgWstring|Wstring]]##, ##**Operator Strptr**## still returns a ##[[KeyPgZstring|Zstring]] [[KeyPgPtr|Ptr]]##, which may not be the desired result.
The related ##[[KeyPgOpVarptr|Operator Varptr (Variable pointer)]]## and ##[[KeyPgOpAt|Operator @ (Address of)]]##, when used with a ##[[KeyPgString|String]]##, return the address of the internal string descriptor.
- New to ""FreeBASIC"", but does exactly the same thing as ##[[KeyPgSadd|Sadd]]##
- ##[[KeyPgSadd|Sadd]]##
- ##[[KeyPgOpVarptr|Varptr]]##
- ##[[KeyPgOpProcptr|Procptr]]##
- [[ProPgPointers|Pointers]]
Deletions:
[[KeyPgDeclare declare]] [[KeyPgOperator operator]] **Strptr** ( [[KeyPgByref byref]] //lhs// [[KeyPgAs as]] [[KeyPgString string]] ) [[KeyPgAs as]] [[KeyPgZstring zstring]] [[KeyPgPtr ptr]]
[[KeyPgDeclare declare]] [[KeyPgOperator operator]] **Strptr** ( [[KeyPgByref byref]] //lhs// [[KeyPgAs as]] [[KeyPgWstring wstring]] ) [[KeyPgAs as]] [[KeyPgZstring zstring]] [[KeyPgPtr ptr]]
Returns a ##[[KeyPgZstring Zstring]] [[KeyPgPtr Ptr]]## to a string's character data.
This operator returns a ##[[KeyPgZstring Zstring]] [[KeyPgPtr Ptr]]## that points to the beginning of a string's character data. ##**Operator Strptr**## is the proper method for acquiring the address of a string's character data.
Note that when passed a ##[[KeyPgWstring Wstring]]##, ##**Operator Strptr**## still returns a ##[[KeyPgZstring Zstring]] [[KeyPgPtr Ptr]]##, which may not be the desired result.
The related ##[[KeyPgOpVarptr Operator Varptr (Variable pointer)]]## and ##[[KeyPgOpAt Operator @ (Address of)]]##, when used with a ##[[KeyPgString String]]##, return the address of the internal string descriptor.
- New to ""FreeBASIC"", but does exactly the same thing as ##[[KeyPgSadd Sadd]]##
- ##[[KeyPgSadd Sadd]]##
- ##[[KeyPgOpVarptr Varptr]]##
- ##[[KeyPgOpProcptr Procptr]]##
- [[ProPgPointers Pointers]]


Revision [14108]

Edited on 2009-01-24 22:19:42 by CountingPine [link to sadd and var|procptr]
Additions:
- New to ""FreeBASIC"", but does exactly the same thing as ##[[KeyPgSadd Sadd]]##
- ##[[KeyPgSadd Sadd]]##
- ##[[KeyPgOpVarptr Varptr]]##
- ##[[KeyPgOpProcptr Procptr]]##
Deletions:
- New to FreeBASIC


Revision [11601]

The oldest known version of this page was created on 2007-11-10 03:14:10 by JeffMarshall [link to sadd and var|procptr]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki



sf.net phatcode