newbie question

Just starting out? Need help? Post your questions and find answers here.
Jurgen
User
User
Posts: 37
Joined: Mon Sep 08, 2003 11:53 pm

newbie question

Post by Jurgen »

why is there a .l after these fields ?

Code: Select all

Structure FileDef 
op.l 
hFile.l 
dataptr.l 
datalen.l 
keyptr.l 
keylen.l 
keyno.l 
EndStructure 

OpenResult.l
Kale
PureBasic Expert
PureBasic Expert
Posts: 3000
Joined: Fri Apr 25, 2003 6:03 pm
Location: Lincoln, UK
Contact:

Post by Kale »

From help manual:
To declare a variable in PureBasic, simply type its name. You can also specify the type you want this variable to be. Variables do not need to be explicitly declared, as they can be used as "variables on-the-fly". The 'DefType' keyword can be used to declare multiple variables in one statement.

Example :
a.b ; Declare a variable called 'a' from byte (.b) type.
c.l = a*d.w ; 'd' is declared here within the expression !

Basic types

PureBasic allows type variables. Theses types are signed and can be standard integers, floats numbers or even string characters. Here is the list of the native supported types and a brief description :

Name Extension Memory consumption Range
Byte .b 1 byte in memory -128 to +127
Word .w 2 bytes in memory -32768 to +32767
Long .l 4 bytes in memory -2147483648 to +2147483647
Float .f 4 bytes in memory unlimited (see below)
String .s length of the string + 1 Up to 65536 characters


:D
Last edited by Kale on Fri Sep 12, 2003 8:26 pm, edited 1 time in total.
--Kale

Image
Jurgen
User
User
Posts: 37
Joined: Mon Sep 08, 2003 11:53 pm

Post by Jurgen »

thanks :idea:
Post Reply