Post Reply 
problems when paste text // (commentary) to the entry line
06-05-2016, 11:17 PM (This post was last modified: 06-06-2016 12:25 PM by compsystems.)
Post: #1
problems when paste text // (commentary) to the entry line
double symbols "//" to convert division (BUG) when they pasted on the input line

to check copy the following code and paste it on the simulator (BAR MENU, EDIT PASTE)

Code:
EXPORT PRG1 ()
BEGIN
// Hello
END;
Find all posts by this user
Quote this message in a reply
06-06-2016, 06:31 AM
Post: #2
RE: problems when copying text (//) to the simulator
Hello,

I am not seeing an issue here. Can you please be more specific as to what is happening on your side?

Regards,
Cyrille

Although I work for the HP calculator group, the views and opinions I post here are my own. I do not speak for HP.
Find all posts by this user
Quote this message in a reply
06-06-2016, 12:17 PM (This post was last modified: 06-06-2016 12:26 PM by compsystems.)
Post: #3
RE:
please follow the following steps (real o simulator calculator)

1: Create a new program with a comment

Code:
EXPORT PRG2 ()
BEGIN
// Hello
END;

then [Shift] [View] (copy menu)
then [All], [copy]
then [Esc] [Esc]
then [Shift] [Menu] (paste)

if the hpprime clipboard it contains double slash // (comment) the hpprime assumes it as double division, be interpreted as a comment, otherwise the copy function does not work
Find all posts by this user
Quote this message in a reply
06-06-2016, 12:53 PM
Post: #4
RE: problems when paste text // (commentary) to the entry line
(06-06-2016 06:31 AM)cyrille de brébisson Wrote:  Hello,

I am not seeing an issue here. Can you please be more specific as to what is happening on your side?

Regards,
Cyrille

I don't know what the OP gets but when I do it, the emulator asks if I want to create a new variable. I answer OK, then get a syntax error.

Tom L

Tom L
Cui bono?
Find all posts by this user
Quote this message in a reply
06-06-2016, 01:59 PM
Post: #5
RE: problems when paste text // (commentary) to the entry line
I have tested this a few different times:

Code:

EXPORT PRG1 ()
BEGIN
// Hello
END;

Using [Shift][Copy] and
[Begin]

EXPORT PRG1 ()
BEGIN
// Hello
END;
[End][Copy]

Then create a "New" program, erasing the new structure, followed by:
[Shift][Paste][Check] and "No errors in the program" results. I can't confirm this reported problem, either.

   

-Dale-
Find all posts by this user
Quote this message in a reply
06-06-2016, 02:05 PM
Post: #6
RE: problems when paste text // (commentary) to the entry line
I think I see what you mean. You are copying something containing "//" and pasting it to the Home or CAS command line. So "1//2" gets parsed as nested stacked fractions in Textbook mode. In Algebraic mode, you get 1//2 which generates a syntax error.

RPN mode actually does seem to treat // as a comment with "1 2 3 // 4 5" parsing the same as "1 2 3". This was also the behavior on the 50g (@ was the comment char).

Just curious, were you hoping the comments would show as comments? or just get ignored?
Find all posts by this user
Quote this message in a reply
06-06-2016, 02:14 PM (This post was last modified: 06-06-2016 09:26 PM by compsystems.)
Post: #7
RE: problems when paste text // (commentary) to the entry line
BIUG, ON ENTRY LINE, PLEASE SEE THE FOLLOWING CAPTURE


Attached File(s) Thumbnail(s)
   
Find all posts by this user
Quote this message in a reply
06-06-2016, 05:04 PM
Post: #8
RE: problems when paste text // (commentary) to the entry line
Copying a program text (containing //) and pasting this copy to a note works fine.
I'm curious: Why you are trying to copy a comment to the entry line?
Find all posts by this user
Quote this message in a reply
06-06-2016, 05:11 PM
Post: #9
RE: problems when paste text // (commentary) to the entry line
(06-06-2016 05:04 PM)Thomas_Sch Wrote:  Copying a program text (containing //) and pasting this copy to a note works fine.
I'm curious: Why you are trying to copy a comment to the entry line?

Probably to create a program object directly which is not supported...

TW

Although I work for HP, the views and opinions I post here are my own.
Find all posts by this user
Quote this message in a reply
06-06-2016, 09:53 PM (This post was last modified: 06-06-2016 10:19 PM by compsystems.)
Post: #10
RE: problems when paste text // (commentary) to the entry line
(06-06-2016 05:04 PM)Thomas_Sch Wrote:  I'm curious: Why you are trying to copy a comment to the entry line?
on the ENTRY line also you can create CAS programs

______________________________________________
f1(x,y,z):=BEGIN local, v1,v2,v3; return x+y+z; END; [enter]
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
then you can edit the program

[Shift]+[Tools](Mem)
then go to "CAS VARS" ITEM
select f1 [EDIT] [EDIT]

the edition appears in a new entry line, should be on full display for easy coding, note that if you paste // the interpreted as a double division and not as a comment also found another problem , the comments disappear when edited and loss of information

I like to comment on my programs, other absolutely not

Code:
// version 0.1 Jun 5 2016 by COMPSYSTEMS
#cas
diff_table(xpr,var):=
    BEGIN
        LOCAL nparts, operator, part1, part2;
        print("");
        //CASE 1: if the expression is a variable name or identifier
        if (type(xpr)==DOM_IDENT) then
            // CASE 2: if the expression is equal to the variable, example diff(x,x)=1, otherwise diff(x,y)=0
            return when(xpr==var,1,0);
        end;
        // number of parts of the expression
        nparts:=part(xpr);
        //operator
        operator:=part(xpr,0);
        //CASE 3: diff(k,v)=0
        //print(nparts); print(operator); wait;
        if (nparts==0) then
            return 0; // xpr=pi, i, numbers
        end;
        if (nparts>1) then
            part1:=part(xpr,1);
            part2:=part(xpr,2);
            print(part1);print(part2);wait;
            else
            part1:=part(xpr,1);
            print(part1); wait;
        end;
        //CASE 4: diff(-f(v),v)=0 // NEG(xpr)
        if (operator=="-") then
            return -1*diff_table(part1,var);
        end;
        //CASE 5: diff(k*f(v),v)=0 // NEG(xpr)
        if (operator="*" and type(part1)==DOM_INT) then
            return part1*diff_table(part2,var);
        end;
        //CASE 6: diff(|f(v)|,v) with f(v)=v
        if (operator=="abs" and string(part1)==string(var)) then
            return sign(var); // assuming a function from R -> R
            //return var/abs(var); // Alternate Form
        end;
        //CASE 7: diff(|f(v)|,v)
        if (operator=="abs" and string(part1)≠string(var)) then
            return sign(var)*diff_table(part1,var);
        end;
        //         //CASE 8: diff(√(f(v)),v)
        //         if operator=="√" and string(part1)==string(var) then
        //             return 1/(2*√(var));
        //         end;
        //         //CASE 9: diff(√(v),v)
        //         if operator=="√" and string(part1)≠string(var) then
        //             return diff_table(part1,var)/(2*√(var));
        //         end;
        
        //CASE 8: diff(ln(v),v)
        if (operator=="ln" and string(part1)==string(var)) then
            return 1/var;
        end;
        //CASE 9: diff(ln(f(v)),v)
        if (operator=="ln" and string(part1)≠string(var)) then
            return diff_table(part1,var)/part1;
        end;
        //fun.trig
        //CASE 10: diff(sin(v),v)
        if operator="sin" and string(part1)==string(var) then
            return cos(var);
        end;
        //CASE 11: diff(sin(f(v)),v)
        if operator="sin" and string(part1)≠string(var) then
            return cos(part1)*deriv(p1,var);
        end;
        //CASE 12: diff(cos(v),v)
        if operator="cos" and string(part1)==string(var) then
            return ­sin(var);
        end;
        //CASE 13: diff(cos(f(v)),v)
        if operator="cos" and string(part1)≠string(var) then
            return ­sin(part1)*deriv(part1,var);
        end;
        //CASE 14: diff(tan(v),v)
        if operator="tan" and string(part1)==string(var) then
            return sec(var)^2 ;
        end;
        //CASE 15: diff(tan(f(v)),v)
        if operator="tan" and string(p1)≠string(var) then
            return sec(part1)^2*deriv(part1,var);
        end;
        
        // codifying
        // ...
        return Done;
    END;
#end

Attached image view, comments disappear in this "windows", impossible uncomment, comments serve to not execute code while the code is created


Attached File(s) Thumbnail(s)
   
Find all posts by this user
Quote this message in a reply
06-07-2016, 05:06 AM
Post: #11
RE: problems when paste text // (commentary) to the entry line
Hello,

OK, I think that I understand what you are trying to do now...

And yes, you are correct, this is not supported by Prime.
Comments are for programs, in programs, but can not be used in the command line.

Cyrille

Although I work for the HP calculator group, the views and opinions I post here are my own. I do not speak for HP.
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)