How to detect TypeOf(var) is a Pointer

Just starting out? Need help? Post your questions and find answers here.
SMaag
Enthusiast
Enthusiast
Posts: 347
Joined: Sat Jan 14, 2023 6:55 pm
Location: Bavaria/Germany

How to detect TypeOf(var) is a Pointer

Post by SMaag »

is there a way to detect, that a defined var is a pointer?

Code: Select all

Define v, *p

Debug TypeOf(v)     ; return 21
Debug TypeOf(*p)    ; ruturn 21
Debug #PB_Integer   ; = 21
; both return as Type Integer!
User avatar
STARGÅTE
Addict
Addict
Posts: 2266
Joined: Thu Jan 10, 2008 1:30 pm
Location: Germany, Glienicke
Contact:

Re: How to detect TypeOf(var) is a Pointer

Post by STARGÅTE »

Names with a * in front are always pointers, and names without a * are always variables.
I do not understand the question.
PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and moreTypeface - Sprite-based font include/module
SMaag
Enthusiast
Enthusiast
Posts: 347
Joined: Sat Jan 14, 2023 6:55 pm
Location: Bavaria/Germany

Solved! How to detect TypeOf(var) is a Pointer

Post by SMaag »

It is not possible. And it is not necessary.
I was completly wrong in my brain!
SMaag
Enthusiast
Enthusiast
Posts: 347
Joined: Sat Jan 14, 2023 6:55 pm
Location: Bavaria/Germany

Re: How to detect TypeOf(var) is a Pointer

Post by SMaag »

it is more complicated.

I opened a new task in the ASM Forum because it is generally an ASM Problem.

viewtopic.php?t=87903
Post Reply