Author Topic: PluriBASIC - Progress of the implementation for Oxygen  (Read 835 times)

0 Members and 1 Guest are viewing this topic.

Offline Brian Alvarez

  • Moderator
  • Full Member
  • *****
  • Posts: 133
    • PluriBASIC
Re: PluriBASIC - Progress of the implementation for Oxygen
« Reply #15 on: November 27, 2018, 10:13:45 AM »
ARRAY SCAN array([startIndex&]) [FOR NumItems&] [, FROM firstChar& TO lastChar&] [, COLLATE {UCASE | charList$}], [= | < | >] stringExpression$, TO matchIndexNumber&

Complete... 90%

 Still need to complete the COLLATE charlist$ feature, but its 2 am and im tired.
« Last Edit: November 28, 2018, 07:15:17 AM by Brian Alvarez »

Offline Brian Alvarez

  • Moderator
  • Full Member
  • *****
  • Posts: 133
    • PluriBASIC
Re: PluriBASIC - Progress of the implementation for Oxygen
« Reply #16 on: November 28, 2018, 07:14:31 AM »
ARRAY SORT mainArray([firstElement&]) [FOR lastElement&][, FROM startChar& TO endChar&][, COLLATE {UCASE | charList$}][, TAGARRAY taggedArray()], {ASCEND | DESCEND}

Complete. But still requires better code for faster execution. For now it will allow me to tets other areas.
It is ussing simple bubble sorting, but the module is open for more sophisticated algorithms.

 It supports Arrays dimensioned with DIM. For not it supports the main data types: Strings, Integers and Floating point. The "Other" mode is not yet implemented,
but it will allow any array. Probably can be implemented by using typeof in the MACRO.

 Again the COLLATE charlist$ is not complete.

Offline Brian Alvarez

  • Moderator
  • Full Member
  • *****
  • Posts: 133
    • PluriBASIC
Re: PluriBASIC - Progress of the implementation for Oxygen
« Reply #17 on: November 28, 2018, 10:25:01 PM »
SPACE$(numChars$)

Complete.

Offline Brian Alvarez

  • Moderator
  • Full Member
  • *****
  • Posts: 133
    • PluriBASIC
Re: PluriBASIC - Progress of the implementation for Oxygen
« Reply #18 on: November 28, 2018, 11:09:26 PM »
BUILD$(s$[, s$][, s$][, s$] [...])

Complete.

Offline Chris Chancellor

  • Sr. Member
  • ****
  • Posts: 269
Re: PluriBASIC - Progress of the implementation for Oxygen
« Reply #19 on: November 28, 2018, 11:24:39 PM »
Thanxx Brian

you are doing very well

Offline Brian Alvarez

  • Moderator
  • Full Member
  • *****
  • Posts: 133
    • PluriBASIC
Re: PluriBASIC - Progress of the implementation for Oxygen
« Reply #20 on: November 28, 2018, 11:44:14 PM »
JOIN$(MyArr$(), {BINARY | ""","""})

Complete... Almost. For now it is only for strings. NUmeric arrays will come later.

 Note that it supports only arrays dimensioned with DIM.

@Chris, Thanks! Its coming along very well. :)

Offline Brian Alvarez

  • Moderator
  • Full Member
  • *****
  • Posts: 133
    • PluriBASIC
Re: PluriBASIC - Progress of the implementation for Oxygen
« Reply #21 on: November 29, 2018, 04:00:14 AM »
Expanded CHR$.

Now it also takes string literals, for example:

? CHR$(40, 41, 40 TO 45, 45 TO 40, "Hello")

It does not take string variables, encapsulated string literals or  multi-part string literals yet though.

Offline Brian Alvarez

  • Moderator
  • Full Member
  • *****
  • Posts: 133
    • PluriBASIC
Re: PluriBASIC - Progress of the implementation for Oxygen
« Reply #22 on: November 29, 2018, 04:10:22 AM »
CHR$$

Complete. It has the same functionality as CHR$, but returns a unicode string.

Offline Brian Alvarez

  • Moderator
  • Full Member
  • *****
  • Posts: 133
    • PluriBASIC
Re: PluriBASIC - Progress of the implementation for Oxygen
« Reply #23 on: November 29, 2018, 10:36:34 AM »

Pointers progressed a lot today...  ;D

Offline Brian Alvarez

  • Moderator
  • Full Member
  • *****
  • Posts: 133
    • PluriBASIC
Re: PluriBASIC - Progress of the implementation for Oxygen
« Reply #24 on: December 04, 2018, 03:11:53 AM »

Equates (constants):

 PluriBASIC supports 5 kinds of equates:
  • ENUM equates.
  • Numeric equates.
  • ANSI String equates.
  • Duplicate equates (given they use a different data type)
  • Unicode String equates.
The following 3 equates are acceptable, even when used in the same program:

Code: [Select]
%MYEQUATE = 1
$MYEQUATE = "Hello World"
$$MYEQUATE = "Hello Europe and Asia"

ANSI string equates cannot contain unicode strings, or unicode portions, as follows:

Code: [Select]
$ANSI_EQUATE = "Some unicode string"$$
But unicode equates can, so, the following syntax is valid:

Code: [Select]
$$UNICODE_EQUATE = "Some unicode string"$$
 With String equates, you cannot use dynamic functions, but as long as you provide literals as parameters, you can use the functions that can be parsed at compilation time:
  •   CHR$
  •   SPACE$
  •   STRING$
  •   GUID$
Equates containing a GUID, are checked at compilation time, and it has to be a valid value. Note that CHR$$ cannot be used for equate creation, only its ANSI counterpart.

With numeric equates, the values are also calculated at compilation time, and they can consist of the following components:
  • Numeric Expressions (1)
  • HEXADECIMAL expressions (&h0001)
  • OCTADECIMAL expressions (&o0001)
  • BINARY expressions (&b0001)
  • Another equates
  • Aritmetic operators
ENUM equates are supported as well, the following syntax is addmitted:

ENUM EquatePrefix [SINGULAR] [BITS] [AS COM]
  EquateMember [= numeric_expression]
  EquateMember [= numeric_expression]
  [...]
END ENUM
When using the SINGULAR switch, the equates are generated without a prefix, but it still needs to be provided for internal diferentiation.

Currently the AS COM switch is supported, but does nothing. The resulting equates may look as follows:

Code: [Select]
%EquatePrefix.EquateMember
Equates can be used in conditional compilation as follows:

Code: [Select]
#IF %DEF(%SOMEQUATE)
Code: [Select]
#IF NOT %DEF(%SOMEQUATE)
Code: [Select]
#IF %SOMEQUATE = 1
Code: [Select]
#IF %SOMEQUATE = %ANOTHEREQUATE
Code: [Select]
#IF %SOMEQUATE => 3.1
Etc.

System equates:

Currently the following system equates are defined, and require no external declaration.
  • $NUL
  • $BEL
  • $BS
  • $TAB
  • $LF
  • $VT
  • $FF
  • $CR
  • $CRLF
  • $EOF
  • $ESC
  • $SPC
  • $DQ
  • $DQ2
  • $SQ
  • $SQ2
  • $QCQ
  • $WHITESPACE
  • %MAX_PATH
  • %FALSE
  • %TRUE
  • %NULL
  • $$NUL
Equates are not included in the final program unless used, just like MACROS, CLASSES, SUB, FUNCTION and UDTs.

Restrictions:
Equates defined inside a RAW segment are not taken into consideration for BASIC code outside the RAW sections, and they may conflict with system-generated equates.




Offline Brian Alvarez

  • Moderator
  • Full Member
  • *****
  • Posts: 133
    • PluriBASIC
Re: PluriBASIC - Progress of the implementation for Oxygen
« Reply #25 on: December 05, 2018, 02:02:13 AM »
Developing PluriBASIC 6.0 using PluriBASIC 5.0
Message box displaying restored text from a UDT element, after successfully saving it and restoring it from a variant variable declared as a variant ptr.

Offline Brian Alvarez

  • Moderator
  • Full Member
  • *****
  • Posts: 133
    • PluriBASIC
Re: PluriBASIC - Progress of the implementation for Oxygen
« Reply #26 on: December 06, 2018, 02:14:59 AM »
TYPEOF(object)
TYPECODE(object)

Complete.

 These are also available now for PowerBASIC 32 bit compilations.
« Last Edit: December 06, 2018, 03:37:53 PM by Brian Alvarez »

Offline Brian Alvarez

  • Moderator
  • Full Member
  • *****
  • Posts: 133
    • PluriBASIC
Re: PluriBASIC - Progress of the implementation for Oxygen
« Reply #27 on: December 07, 2018, 07:41:11 AM »
 Enhanced macros for all platforms. The MACRO blocks now allow child macros as well as parameter dependant code generation.
This applies to all available target platforms, including Android, PowerBASIC, PHP and Oxygen. Instead of explaining how it works,
i will post a picture.

Offline Chris Chancellor

  • Sr. Member
  • ****
  • Posts: 269
Re: PluriBASIC - Progress of the implementation for Oxygen
« Reply #28 on: December 08, 2018, 04:26:53 PM »
Hello Brian

Congratulations to you that you have mastered O2

Quote
Almost all the ideas i have had so far have been possible. With very few exceptions, i have
achieved most of the tasks i wanted! :)

Can you please provide some sample O2 codes in this forum as i have contributed mine ? 

this is to encourage more and more basic programmers to use O2 , we do need to increase
the users community here, more brains is better one or two
Thanxx a lot

Offline Brian Alvarez

  • Moderator
  • Full Member
  • *****
  • Posts: 133
    • PluriBASIC
Re: PluriBASIC - Progress of the implementation for Oxygen
« Reply #29 on: December 08, 2018, 05:36:53 PM »
 Hello Chris, I have been posting the progress exactly for that reason. :)

 Hopefully, soon i will try to port some of the existing examples. If everything goes as expected.
Right now i am finishing THREAD statements.