short calculations

Share your advanced PureBasic knowledge/code with the community.
Primus1
User
User
Posts: 17
Joined: Wed Jan 12, 2011 2:48 pm
Contact:

short calculations

Post by Primus1 »

Instead of doing:

a.i=0
a=a+1
debug(a)

You can do:

a.i=0
a+1
debug(a)

works also with -, / and *
A sketch tool with a twist, SECret INSPiration made using Purebasic.
User avatar
Demivec
Addict
Addict
Posts: 4270
Joined: Mon Jul 25, 2005 3:51 pm
Location: Utah, USA

Re: short calculations

Post by Demivec »

With all due respect this doesn't qualify as a tip or trick, it's documented in the PureBasic Help file under "Variables and Types".
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: short calculations

Post by ts-soft »

Some other hints:
You should use Code Tags:
[ code ].... your code ... [ /code ] ) without the spaces!
And put

Code: Select all

EnableExplicit
on the first line

Greetings - Thomas
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
Post Reply