Author Topic: Equivalent of PB STRING$() function  (Read 108 times)

0 Members and 1 Guest are viewing this topic.

chrisc

  • Sr. Member
  • ****
  • Posts: 257
  • beginner programmer
Equivalent of PB STRING$() function
« on: March 22, 2018, 06:11:59 AM »
in PB there is a STRING$() function which
         Return a string consisting of multiple copies of the specified character.

Code: [Select]

Syntax
s$ = STRING$(Count&, Character%)

example
A$ = STRING$(8, "0")             '  Results  A$ = "00000000"


Is there an equivalent function in O2 ?

chrisc

  • Sr. Member
  • ****
  • Posts: 257
  • beginner programmer
Re: Equivalent of PB STRING$() function
« Reply #1 on: March 22, 2018, 06:40:43 AM »
i found it,    STRING$()   becomes  STRING()

it is the same

John

  • Hero Member
  • *****
  • Posts: 3001
Re: Equivalent of PB STRING$() function
« Reply #2 on: March 22, 2018, 06:54:48 AM »
With Script BASIC, the $ reference for strings and string functions are optional. It would be nice if O2 followed suit.

LET and line numbers (line labels) are allowed if you think they are needed.

Charles Pegge

  • Admin Support Member
  • *****
  • Posts: 3584
    • Oxygen Basic
Re: Equivalent of PB STRING$() function
« Reply #3 on: March 22, 2018, 07:16:30 AM »
Hi John,

$ endings are allowed but ignored.

let is suported, but not PB's object syntax.

line numbers are supported as labels


John

  • Hero Member
  • *****
  • Posts: 3001
Re: Equivalent of PB STRING$() function
« Reply #4 on: March 22, 2018, 08:08:31 AM »
Sounds like O2 is already SB compatible.  ;)