E Everest Member Licensed User Longtime User Dec 6, 2013 #1 Hello, I am returning after a year away. One year ago constants were not supported. I do not find any reference in the user guide. Are they supported in Version 3? Regards, Mark
Hello, I am returning after a year away. One year ago constants were not supported. I do not find any reference in the user guide. Are they supported in Version 3? Regards, Mark
JoanRPM Active Member Licensed User Longtime User Dec 6, 2013 #2 No, I assing the constans like this: Code: Copy Sub Process_Globals 'Constants Dim x As Int : x = 3 ... Upvote 0
No, I assing the constans like this: Code: Copy Sub Process_Globals 'Constants Dim x As Int : x = 3 ...
E Everest Member Licensed User Longtime User Dec 6, 2013 #3 Hello, Thanks for the response. Yeah that is really an initialized variable. Ciao, Mark Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Dec 8, 2013 #4 The language doesn't yet support constants. Upvote 0
mangojack Expert Licensed User Longtime User Dec 8, 2013 #5 Could someone supply a brief explanation re the difference between the above initialized variable (post #2) and a Constant Would not the variable declared in Process_Globals be the equivalent of a Constant ? Cheers mj Upvote 0
Could someone supply a brief explanation re the difference between the above initialized variable (post #2) and a Constant Would not the variable declared in Process_Globals be the equivalent of a Constant ? Cheers mj
Erel B4X founder Staff member Licensed User Longtime User Dec 8, 2013 #6 Note that you can write: Code: Copy Dim x As Int = 3 About your question, the difference is that the compiler doesn't allow you to change the value of a "constant". This is not the case here. You can change x in your code to a different value. By setting a constant it is clear that the value will never change.[/code] Upvote 0
Note that you can write: Code: Copy Dim x As Int = 3 About your question, the difference is that the compiler doesn't allow you to change the value of a "constant". This is not the case here. You can change x in your code to a different value. By setting a constant it is clear that the value will never change.[/code]