For the docs

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
pdwyer
Addict
Addict
Posts: 2813
Joined: Tue May 08, 2007 1:27 pm
Location: Chiba, Japan

For the docs

Post by pdwyer »

There doesn't seem to be anything in the help files on constants. There some info under enumeration but no section or anything under types.

Perhaps I just missed it?

I was trying to track down if they were longs or not or if you can have floats or 16bit ints? Or if there are just longs and strings?

Thanks
Paul Dwyer

“In nature, it’s not the strongest nor the most intelligent who survives. It’s the most adaptable to change” - Charles Darwin
“If you can't explain it to a six-year old you really don't understand it yourself.” - Albert Einstein
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

They can be integer (from byte to quad), float (up to double) or string.
User avatar
pdwyer
Addict
Addict
Posts: 2813
Joined: Tue May 08, 2007 1:27 pm
Location: Chiba, Japan

Post by pdwyer »

How do you type them?

Code: Select all


#fl.f = 3.12

---------------------------
PureBasic
---------------------------
Line 1: A constant can't have a type.
---------------------------
OK
---------------------------

=======================================

One more for the docs

I know theres a way to have put hex in source code (in VB it's &h100) but I can't never remember in PB $, #, % or something prefixed

Could that go in the docs too as I can't find it there

Thanks :)
Paul Dwyer

“In nature, it’s not the strongest nor the most intelligent who survives. It’s the most adaptable to change” - Charles Darwin
“If you can't explain it to a six-year old you really don't understand it yourself.” - Albert Einstein
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

You don't type a constant, you just put something in it.

The prefix is described under "General Rules"
Post Reply