Page 1 of 1

For the docs

Posted: Wed May 21, 2008 2:05 pm
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

Posted: Wed May 21, 2008 2:07 pm
by Fred
They can be integer (from byte to quad), float (up to double) or string.

Posted: Wed May 21, 2008 2:14 pm
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 :)

Posted: Wed May 21, 2008 3:10 pm
by Fred
You don't type a constant, you just put something in it.

The prefix is described under "General Rules"