TERN accept no expression(s)


Today 18:02
Forum: Proton Plus Compiler v3
Starter: towlerg
Views: 0
Replies: 0
Today 00:44
Forum: Proton Plus Compiler v3
Starter: davroski
Views: 0
Replies: 4
+ Reply to Thread
Results 1 to 4 of 4

Thread: TERN accept no expression(s)31 days old

  1. #1
    Member Frizie's Avatar
    Join Date
    Apr 2003
    Posts
    165
    Thumbs Up
    Received: 12
    Given: 1
    Total Downloaded
    491.12 MB

    0 Not allowed!

    Question TERN accept no expression(s)

    Thanks Les for adding the new command TERN .

    In some of my programs I have already with succes replaced the IF..THEN..ELSE by TERN.
    But if there are exprressions in it, I get the error: Expressions not supported at this position!

    Example, first the IF..THEN..ELSE variant:

    IF TonsInstelling = FALSE THEN
    Display = DrukInstelling * .35
    ELSE
    Display = DrukInstelling
    ENDIF


    Now the TERN variant:

    Display = TERN (TonsInstelling = FALSE, DrukInstelling * .35, DrukInstelling)

    The Proton manual writes that this must be possible (ValueIfTrue can be any valid variable, constant, expression or procedure call...)

    Regards Frizie.
    Ohm sweet Ohm: www.picbasic.nl

  2. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  3. #2
    Junior Member keytapper's Avatar
    Join Date
    Jun 2019
    Posts
    30
    Thumbs Up
    Received: 2
    Given: 1
    Total Downloaded
    76.29 MB

    0 Not allowed!

    Default Re: TERN accept no expression(s)

    I'd rather opt the form of python
    Code:
    a=0 If <evaluate true> Else 234
    Anyway I welcome the new implementation.

  4. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  5. #3
    Prolific Poster johngb's Avatar
    Join Date
    Oct 2003
    Posts
    2,120
    Thumbs Up
    Received: 104
    Given: 1
    Total Downloaded
    2.42 GB

    0 Not allowed!

    Default Re: TERN accept no expression(s)

    In Pascal there is a similar form for setting a boolean which I use regularly.

    Variable = (Variable1 evaluate Variable2)

    For boolean values I find this form more readable.
    JohnB

  6. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  7. #4
    Fanatical Contributor top204's Avatar
    Join Date
    Feb 2002
    Posts
    3,278
    Thumbs Up
    Received: 380
    Given: 137
    Total Downloaded
    1.59 GB

    0 Not allowed!

    Default Re: TERN accept no expression(s)

    Unfortunately, this is a Typo in the compiler manuals. :-( For speed, I used a section of text from another command's parameters section and forgot to remove the "Expression" part.

    I'll see what I can do inside the compiler.

    If you look at All computer languages that have this type of mechanism in place, none of the use the same Syntax. Some, such as C and C++ use this form so it actually looks confusing, as do others that have a single operator. I came up with the name "Tern" because it is a form of "Ternary" operation. However, the compiler also accepts "IfThen" or "Iif" in place of "Tern", because I couldn't quite make my mind up which one was more clear. LOL

    I'm so sorry John. I forgot to send you an email with some of the new commands that have been added to the compile for the syntax highlighting. It's such a shame that the syntax highlighting of the ProtonStudio cannot be adjusted by a file, the same as UltraEdit or the current IDE.
    Last edited by top204; 18th July 2019 at 11:09.

  8. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Expression format
    By danbicks in forum Proton Plus Compiler v3
    Replies: 5
    Last Post: 6th January 2013, 19:03
  2. In order to read the forum, you have to accept the terms of use
    By Lester in forum Website / Forum Issues
    Replies: 5
    Last Post: 8th November 2012, 06:53
  3. Evaluating an Expression
    By robbed666 in forum Proton Plus Compiler v3
    Replies: 3
    Last Post: 6th March 2010, 22:03
  4. For Next expression not working
    By Latex in forum Proton Plus Compiler v3
    Replies: 26
    Last Post: 20th December 2007, 09:08

Members who have read this thread : 92

Actions :  (Set Date)

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts