What means "Var" for a C/AL Locals Parameter

Hi, I’ve see that for a local parameter, a column named “Var” exist and sometime it’s checked [?]. What’s that ? Someone can help me ? Thanks Luc

If parameter is a VAR parameter (that is, called ByRef) and data is used inside the event trigger, there will be an implicit conversion just before the event trigger returns. A check is made of whether conversion is possible. If this is not the case, an error message is shown and the event trigger terminates.

Basically and easy… when you’ve a parameter with VAR you’re passing the variable (full variable) and it will be allowed to be modified by that function. If you don’t set it as VAR it will be just the value what you get (example if your parameter is boolean, if you don’t set it as var you can set as parameter on your function myfunction( TRUE )… if your parameter is set as var you’ll have to use a boolean variable myfunction(mybool) ) Regards,

Advice: Go to your local library and get a book on Pascal programming. This will help you understand the syntax and base structure of C/AL.

quote:


Originally posted by LBR
Hi, I’ve see that for a local parameter, a column named “Var” exist and sometime it’s checked [?]. What’s that ? Someone can help me ? Thanks Luc


Luc! I see that you didn’t read PDF’s that i send you! [:(!] bostjanl

No, not yet, sorry but i’m doing the migration from 3.01 to 3.6 and my time is count. [:I]

You’re doing the migration from 3.01 to 3.6 and don’t still know what VAR means?? oh, my god!!!

ByVal (VAR unchecked) = Value of Variable gets passed to the function via the stack. ByRef (VAR checked) = Function does not get the value of the variable, but the address of the variable, and works directly on the value on that memory address.

quote:


Originally posted by apertierra
You’re doing the migration from 3.01 to 3.6 and don’t still know what VAR means?? oh, my god!!!


Alfonso, you must be the one and only guru in the Navision world. Having a “Yes, that is my opinion” on every topic to collect “stars”. Nobody critcised YOU about writing your dump comments to all the topics. What are you measures to say “… oh, my god!!!” (btw, only one “!” or “?” at the end of a sentence). Everyboby is learning every day and has questions. So, please do not make this comments anymore. It’s Friday today. Think about it. Walter

Walter… 1) I don’t write on the forum just for collecting starts… is that what you do so you thinks others do the same? (If i need starts i just look at the sky). 2) I’m not a guru at all and maybe my comments are totally dump, but usually are trying to help. 3) I can use as many “!” as i want… you’re so good at gramatical so you probably know what’s the meaning on “emphasis”. 4) Everybody is learning every day…i agree… everybody can have questions and that’s why we usually try to help them, but when somebody is trying to do an upgrade from 3.01 to 3.60 it’s suppose not to be a beginner user… and if somebody is asking what VAR means (that’s on the basic development manual totally explained) i’ve to think that it’s a beginner user… so… will you recomend a beginner user doing an upgrade??? I don’t think so…That’s being really brave… Regards

I was going to comment, but Walter said what I wanted to say. To all developers (new and old), please feel free to ask ANY questions no matter how silly they may seem, there are many people out here that want to help. PS: Erik please lets remove the stars. (or at least give me back the 700 replies that I lost when I changed my login ID [}:)] )

Off topic!

quote:


Originally posted by apertierra
3) I can use as many “!” as i want…


Don’t use an exclamation mark unless you’re certain it’s necessary ‹ and never use two or three of them in a row: *This is a sensational result!!! Alfonso, please read more here: http://www.cogs.susx.ac.uk/local/doc/punctuation/node06.html I am currently thinking whether your comment was another dunmp one or not.

Guys, shouldn’t we just get on-topic again? Luc, did Lars’ answer help you or are you still having problems?

Yes Marco, the answer help me, thanks. I agree with all of you, maybee it’s not the best way to work, but for certain company it’s the real life, and I progress a lot with that way of acting. And I’m happy [:)]to say that the migration from 3.01 to 3.6 is a big success with only 1 day of work for a NSC (sorry for the NSC [;)] but we need the migration tool (Nav. Attain Dev Toolkit) and his migration licence)). The migration included 64 tables, 112 forms, 65 reports, 22 CU, 10 dataport create or customized by myself and my colleague (ex: CU 80,81,90,397,…; table 27,32,38,39,…) And finaly I think I ask again dumb questions in the future but I learn a lot and it’s not a problem for me. Thanks to all and see you soon on this forum (maybee to help you ? [;)]… I hope) Luc