Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Removed translated content for 'zh'
Sv translation
languageen

BellaDati doesn't support the usual while {...} and for {...} loops like Java. Instead of this, you can use closures in place of most for loops using each():

Code Block
def stringList = [ "java", "perl", "python", "ruby", "c#", "cobol",
                   "groovy", "jython", "smalltalk", "prolog", "m", "yacc" ];

a = 'values: '
stringList.each() { values += it };
return a

Looping over splitted string

Code Block
s = 'This is string'

a = 'values: '
split(s, '').each() { values += it };
return a
Sv translation
languageja

BellaDatiは{...} Javaのようにwhile {...} および{...}をサポートしていません。その代わりに、each()を使用することでループのほとんどの代わりにクロージャを使用できます。

Code Block
def stringList = [ "java", "perl", "python", "ruby", "c#", "cobol",
                   "groovy", "jython", "smalltalk", "prolog", "m", "yacc" ];

a = 'values: '
stringList.each() { values += it };
return a

分割された文字列をループ 

Code Block
s = 'This is string'

a = 'values: '
split(s, '').each() { values += it };
return a