Sorry, GPI, I guess I just have some throwbacks from my PowerBasic days. This is how they do it:
Code: Select all
DIM fixedstring AS ASCIIZ * 255 ' string will be 255 bytes long, including the end zero
' OR
DIM fixedstring AS STRING * 255 ' string will be 255 bytes long, period
As far as ".c" and ".d" not making sense, ".c" stands for char, which is kind of the way they do it in C. And ".d", as you may have guessed, stands for double. It makes a lot more sense, if you ask me, than using weird symbols that you have to remember like in Blitz. I
(".ub" for "unsigned byte" is pretty straightforward, I think...)
In PowerBasic it's even more difficult. Here's a page from their data types explanation:
(The tab spacing looks great in the 'post a reply' edit window, but gets screwed up when it's put in quote or code blocks).
Code: Select all
Variable Type Indicator Element size DEF type * Type Keyword
Pointer @ (leading) 4 N/A PTR
Integers
Integer % 2 DEFINT INTEGER
Long Integer & 4 DEFLNG LONG
Quad Integer && 8 DEFQUD QUAD
Unsigned Integers
Byte ? 1 DEFBYT BYTE
Word ?? 2 DEFWRD WORD
Double Word ??? 4 DEFDWD DWORD
Floating Point
Single precision ! 4 DEFSNG SINGLE
Double precision # 8 DEFDBL DOUBLE
Extended precision ## 10 DEFEXT EXT
Currency
Currency @ 10 DEFCUR CUR
Extended Currency @@ 10 DEFCUX CUX
Strings **
String $ 4 DEFSTR STRING
ASCIIZ string N/A N/A N/A ASCIIZ
Fixed-length string N/A N/A N/A STRING * x
(sorry the tabs don't line up in this window...)
I can't honestly see where there would be any confusion...

Can you imagine having to remember "!,# or ##" for float, or "?,?? or ???" for unsigned intergers, etc? I think PureBasic can do better than that (although it is very nice to have so many different type to use in PowerBasic...)
Russell