Page 1 of 1

v2 Type - Examples

Posted: 26 Jul 2021, 04:51
by jNizM
v2 Type - Examples
(https://lexikos.github.io/v2/docs/commands/Type.htm#Examples)

Add Examples for VarRef and Buffer

Code: Select all

d := "4"
MsgBox Type(&d)		; -> VarRef

Code: Select all

buf := Buffer(10)
MsgBox Type(buf)	; -> Buffer
Image


Edit:
Also Type detect Objects (like IsObject())

Code: Select all

obj := { key: "value" }
MsgBox Type(obj)	; -> Object

Re: v2 Type - Examples

Posted: 29 Jul 2021, 10:32
by safetycar
I was about to write about the documentation for "Type", and I saw this one that fits the topic. (Sorry if it would have been better to make my own.)

A part from those mentioned by @jNizM, there is also Func.
But also, as I understand it the enumeration of types in the introduction is outdated, because it says you can only get String, Integer and Float.
https://lexikos.github.io/v2/docs/commands/Type.htm
From what I've seen around VarRef, Buffer and Func need to be added to the documentation, I don't know if there are more.

Re: v2 Type - Examples

Posted: 29 Jul 2021, 11:11
by swagfag
and it says so "for primitive values"". Buffer, Func and VarRef aren't primitive values;
  • 123
  • 1.23
  • ""
are
so, nothing wrong with the documentation nor is it outdated

Re: v2 Type - Examples

Posted: 29 Jul 2021, 11:23
by safetycar
swagfag wrote:
29 Jul 2021, 11:11
and it says so "for primitive values"". Buffer, Func and VarRef aren't primitive values;
  • 123
  • 1.23
  • ""
are
so, nothing wrong with the documentation nor is it outdated
Ok, I got your point.
I just wanted to say that it would be good to know that those other values can be returned too.

Re: v2 Type - Examples

Posted: 18 Sep 2021, 10:49
by safetycar
I just found out that there is this page:
Built-in Classes (https://lexikos.github.io/v2/docs/objects/index.htm)
Which is pretty close to what I wanted to know when I was talking about this.

This page is missing from the "Index" tab of the docs. I found it because I saw it searching something else on "Search".
And it might also be interesting to link it from the Type docs.