Support for comments /* ... */
|
02-24-2017, 05:36 PM
(This post was last modified: 02-24-2017 06:05 PM by compsystems.)
Post: #1
|
|||
|
|||
Support for comments /* ... */
Hello
One way to better visualize a code, where a function has several arguments (for example input( arg1, arg2, ..., argn), is to write each argument in a separate line input ( arg1, arg2, ..., argn ); But if you want to comment with // the code generates error, because the comment covers until the end of the sentence (; ), for this we need comments of the form / * * / PHP Code: export testInputList() Successful compilation But not with PHP Code: INPUT The problem would be solved in the following way PHP Code: INPUT |
|||
02-24-2017, 07:51 PM
Post: #2
|
|||
|
|||
RE: Support for comments /* ... */
(02-24-2017 05:36 PM)compsystems Wrote: Hello Would the following be equivalent? PHP Code: INPUT Tom L Cui bono? |
|||
02-24-2017, 07:58 PM
Post: #3
|
|||
|
|||
RE: Support for comments /* ... */
(02-24-2017 07:51 PM)toml_12953 Wrote: The problem would be solved in the following way Yes but the compiler does not allow this type of comments = ( |
|||
02-25-2017, 12:25 AM
(This post was last modified: 02-25-2017 12:29 AM by StephenG1CMZ.)
Post: #4
|
|||
|
|||
RE: Support for comments /* ... */
Changing the compiler to allow // comments on each line would be helpful, particularly when you have a long list of data
PlanetDistance:={ 0.2,//Mercury 0.4,//Venus 1//AU } I For function parameters, I have always liked the OPTIONAL ADA syntax for readability and avoidance of getting parameters confused, although for my own code I could remember the parameter sequence anyway without needing it: TIMED(HOURS, MINS, SECS) Return 60* ((60*hours)+mins)+secs; END ... Timed(hours=3,mins=2); Timed(secs=1,mins=2);//the prefixes mean you don't need to remember which parameter is 1st Timed(1,2,3); // the xxxx= is optional I could imagine that syntax being useful when using a portable device with a small Screen makes looking up parameters difficult. An alternative would be to have a way to search for user procedures and parameters, either within the editor (Find...), or by lookup within Help. Stephen Lewkowicz (G1CMZ) https://my.numworks.com/python/steveg1cmz |
|||
02-26-2017, 03:39 PM
(This post was last modified: 02-26-2017 03:40 PM by compsystems.)
Post: #5
|
|||
|
|||
RE: Support for comments /* ... */
also, if in a future firmware version, it supports comments of the type,
You could directly copy the following sequence of steps (of this forum) to the history view PHP Code: expr1:=x^3; currently I have to suppress them =( PHP Code: expr1:=x^3; PHP Code: expr1:=x^3; rpnStr:=""; oper:=""; partn:=""; oper:=part(expr1,0); parts:=part(expr1); partJ:=1; expr2:=part(expr1,partJ); partn:=string(expr2); rpnStr:=rpnStr + partn; partJ:=2; expr2:=part(expr1,partJ); partn:=string(expr2); rpnStr:=rpnStr + " ";rpnStr:=rpnStr + partn; rpnStr:=rpnStr + " " + oper; I can not put comments between each sentence = ( |
|||
02-26-2017, 04:24 PM
Post: #6
|
|||
|
|||
RE: Support for comments /* ... */
The problem is that to do more things with comments requires us to turn it into a 2 step compilation process, with creating duplicate text for step 2. Right now there is not a preprocessor, nor enough memory to really do so on the hardware. There are not plans to support additional commenting methods at the moment.
[/quote] TW Although I work for HP, the views and opinions I post here are my own. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 4 Guest(s)