Constants with if .. else

Just starting out? Need help? Post your questions and find answers here.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by cor.

Constants get always the latest defined value even if processed by if.. else

Is this always true for a programming language? or is it only by PB

I need this for settings values before opening the main window

take e.g.

It always comes with value mx=11

procedure setx(value.s)
if value="First"
#mx=10
else
#mx=11
endif

endprocedure

setx("First")

Using Windows 98 SE
Registered PB version : 2.90 (Windows)
--------------------------
C. de Visser
Author of Super Guitar Chord Finder
http://www.ready4music.com
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by fred.

Constants are defined at compiling stage/ BTW, a constants shouldn't be changed. Declare it only once. Yes, it's like that in every langage (else it's not constant).

Fred - AlphaSND
Post Reply