Hi,
I'm a new user of Multichart and Powerlanguage.
Before I used an other software in javascript, so I'm trying to get my bearings.
About Input, I saw in some code snipets that it's possible to insert an input declaration in more points of the code. So, it's not important to use input declarations at the start of the code. It is correct ?
In javascript it was possible to list a number of options for every input item to choose from during data entry. It seemed easy, and that reduced the possibility of entering the data incorrectly.
Is it possible to specify the OPTIONS of input in PowerLanguage too?
I could not find information about that.
Best regards
Massimo
Input ? [SOLVED]
- TJ
- Posts: 7740
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2221 times
Re: Input ? [SOLVED]
That is correct. You can declare your INPUT or VARIABLES anywhere in the code.Hi,
I'm a new user of Multichart and Powerlanguage.
Before I used an other software in javascript, so I'm trying to get my bearings.
About Input, I saw in some code snipets that it's possible to insert an input declaration in more points of the code. So, it's not important to use input declarations at the start of the code. It is correct ?
However you must declare the input or variables before they are used in the code.
With EasyLanguage, you implicitly declare the type in the INPUT or VAR declaration.In javascript it was possible to list a number of options for every input item to choose from during data entry. It seemed easy, and that reduced the possibility of entering the data incorrectly.
Is it possible to specify the OPTIONS of input in PowerLanguage too?
I could not find information about that.
Best regards
Massimo
eg.
Code: Select all
INPUT:
myrisk(200),
mytext("Good Morning");
while mytext is a string because you have entered a text with quotation marks "" inside the brackets.
Once you have compiled the indicator and applied it to a chart, you can change the input value any time you like. But you cannot change the type. Eg. You cannot put a text in myrisk because it has already been implicitly declared as numeric. And you cannot put a number in mytext because the quotation marks "" has been used to implicitly declare it as string.
Hope the above helps.