my commandbutton is created using code in custom section
May I know what property I should set using code as I do not have an attributes panel for commanbutton created in code?
In the top of your custom section, public the variable you are going to use for the button – under where it says namespace.
// Lianja custom section for page "page1" section "section2"
define class page1_section2 as section
Then anywhere in the code, you can just use
and of course to show it, you use tekbutton1.show.
tekbutton1.hide is the same thing as tekbutton1.visible = .f.
tekbutton1.show is the same thing as tekbutton1.visible = .t.
Namespaces allow you to declare public variables, which are only public within that namespace. So, I could have 2 separate public variables called m_var, providing at least one of them was in a namespace. A procedure or function with the same namespace declared would be able to access the m_var from that namespace or it could be accessed as namespace.m_var from anywhere. It’s useful if there is a risk of having conflicting public variable names – for example, if you are adding Page or Section templates or Pages from the Page Library to your App.
by specifying the namespace in a delegate or procedure, variables do not need to be prefixed by the namespace.
// peoplekiosk.myvar and myvar reference the same variable
Tip #1: you can use the namespace() function to save the current namespace and set it back later in your code.
Tip #2: To disable the namespace just specify
Tip #3: how to inspect a namespace? Try this in the console.
public myvar = "hello world"
Surprise surprise, namespaces are just objects that encapsulate public variables and other things (more on that later).
I have a desktop app and I wish to make variable initialised in one page visible to all other pages
In my case, my initial page is a page with custom section
I have public some variables and initialised the values of these public variables but I am not able to see the variables value in other pages
May I know how I can expose the variables created in my custom section of my initial page to all other pages
You probably have a namespace statement in your custom section code. That being the case you need to prefix the reference of your public variables by the name of the namespace e.g.
in another page you must reference it like this