Author Topic: Error Parsing "If"  (Read 11933 times)

0 Members and 3 Guests are viewing this topic.

Mike Lobanovsky

  • Guest
Re: Error Parsing "If"
« Reply #30 on: May 28, 2014, 03:49:51 PM »
John,

What will your print a look like?

Charles Pegge

  • Guest
Re: Error Parsing "If"
« Reply #31 on: May 28, 2014, 03:51:37 PM »
Yes, yes! else terminates an expression in all cases.

Oxygen also supports multiline strings btw.
Can be confusing when one quote mark is missing :)
« Last Edit: May 28, 2014, 03:59:45 PM by Charles Pegge »

JRS

  • Guest
Re: Error Parsing "If"
« Reply #32 on: May 28, 2014, 03:53:50 PM »

Code: [Select]
a = _
"""
"Multi",
"Line',
'String'
"""

PRINT a,"\n"


jrs@laptop:~/sb/sb22/test$ scriba mls.sb

"Multi",
"Line',
'String'

jrs@laptop:~/sb/sb22/test$

JRS

  • Guest
Re: Error Parsing "If"
« Reply #33 on: May 28, 2014, 03:57:02 PM »
Quote
Can be confusing when one quote mark is missing :)

Major contributor to hair loss.

Mike Lobanovsky

  • Guest
Re: Error Parsing "If"
« Reply #34 on: May 28, 2014, 04:01:53 PM »
Oh,

Charles, my English must be failing me tonight. :)

Yes, yes!

Does it mean

"Yes, it does. It does need a colon within this context!"

or

"No, it doesn't. It does not need a colon within this context!"

The reason why I'm asking is because the Russian sentences like "No, it does" and "Yes, it doesn't" are perfectly legal and only correct from the Russian grammar perspective.

Sorry for being especially dumb tonight.


P.S.
Quote
Can be confusing when one quote mark is missing :)

Should have proper syntax highlighting in your editor to avoid confusion. :P
« Last Edit: May 28, 2014, 04:15:39 PM by Mike Lobanovsky »

Mike Lobanovsky

  • Guest
Re: Error Parsing "If"
« Reply #35 on: May 28, 2014, 04:02:58 PM »
Major contributor to hair loss.

Anything to lose yet? ;)

Quote
"Multi",
"Line',
'String'

Understood. """ is simply a marker of a multiline string.

Charles Pegge

  • Guest
Re: Error Parsing "If"
« Reply #36 on: May 28, 2014, 04:14:13 PM »
Mike,

Yes, else it does not need a colon, and No, a colon is unnecessary :)

However in the older single liner syntax colons must not be used


if a=1 then b=1 : : : : else : : : : b=5
if a=1 then b=1  else b=5

New:
if a=1 then : b=1  else b=5 : end if
if a=1 then : b=1 :  else : b=5 : end if
if a=1 : b=1 :  else : b=5 : end if




« Last Edit: May 28, 2014, 04:22:59 PM by Charles Pegge »

Mike Lobanovsky

  • Guest
Re: Error Parsing "If"
« Reply #37 on: May 28, 2014, 04:24:07 PM »
Yes, else does not need a colon

1. I thought Pegge looked more an Italian, not Russian, last name to me. :D

1. OMFG! From bad to worse... Charles, you owe me two bottles of beer this evening. First, for all the hopes I lost in this discussion. And second, for the new brand name I invented for Oxygen: Crypt-o-BASIC!

I should sleep it off on a pill. See you tomorrow, gentlemen!

:D

Charles Pegge

  • Guest
Re: Error Parsing "If"
« Reply #38 on: May 28, 2014, 04:34:54 PM »
Goodnight both,

Unfortunately, I have no beer in stock, though I have port and some brandy. But what you really need is some of my cocoa and ginger porridge. :)


Update:
http://www.oxygenbasic.org/o2zips/Oxygen.zip

PS:
To check which version of Oxygen you have:
print version
"A40 08:44 29/05/2014"
Further update.

This single liner format is now supported (no colons required)
if a=1 then b=2 else b=99 end if
as well as:
if a=1 then b=2 else b=99

Mike's original quest is also satisfied:
if a=1 then : b=1
c=2
end if



Also set a better trap for unclosed quotes

« Last Edit: May 29, 2014, 12:35:58 AM by Charles Pegge »

Mike Lobanovsky

  • Guest
Re: Error Parsing "If"
« Reply #39 on: May 29, 2014, 02:16:18 AM »
To check which version of Oxygen you have:...
This single liner format is now supported (no colons required)...
as well as:...
Mike's original quest is also satisfied:...
Also set a better trap for unclosed quotes

Hi Charles,

This looks much much better than a plate of ginger porridge or even two bottles of beer.

Thanks a lot! :D