v2 Type - Examples

Share your ideas as to how the documentation can be improved.
User avatar
jNizM
Posts: 3183
Joined: 30 Sep 2013, 01:33
Contact:

v2 Type - Examples

26 Jul 2021, 04:51

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
[AHK] v2.0.5 | [WIN] 11 Pro (Version 22H2) | [GitHub] Profile
safetycar
Posts: 435
Joined: 12 Aug 2017, 04:27

Re: v2 Type - Examples

29 Jul 2021, 10:32

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.
swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: v2 Type - Examples

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
safetycar
Posts: 435
Joined: 12 Aug 2017, 04:27

Re: v2 Type - Examples

29 Jul 2021, 11:23

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.
safetycar
Posts: 435
Joined: 12 Aug 2017, 04:27

Re: v2 Type - Examples

18 Sep 2021, 10:49

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.

Return to “Suggestions on Documentation Improvements”

Who is online

Users browsing this forum: No registered users and 7 guests